This would not work well at the moment because MooseGroupRuntimeStorage is used also for
all moose groups. We would need to have a storage that is less demanding for handling
associations, and then we could rely on having name for everything.
Doru
Hi Doru,
Most elements we have a unique name, and we should be able to find them (fast) by using
the lookup. This is what "at: ifAbsent:" implies. I don't think this method
can be used on an entity that does not have a unique name. There is only one problem:
1) either we assert that a change in the moose name is not possible. This means that if
we have a cache miss, we should execute the exception block.
2) Or we assume that a change in the moose name is possible. This means that we have to
check if we have a cache hit, and have to go through all elements if we have a cache
miss.
Currently the implementation is a bit heuristic, returning if we have a cache hit, and
adding when we go through all elements. My problem is that the tests rely on this
"mixed" behavior. So … I do not understand why it was built this way.
When I look at the implementation of MooseEntity mooseName, it uses a privateState to
cache the mooseName, but it returns before it actually stores it. And removing the return
statement causes a lot of tests to fail. So this means that the Moose name changes …
Diego