Man, this is messed up :).
The mooseName should better be cached as it is not expected to change. The
tests fail precisely because it is the tests that want to go around these
issue and introduce namespaces artificially after the actual import. Take a
look at:
FAMIXNavigationPluginTestsResource>>importModel
But, for associations we have no benefit of caching them by name because we
never look them up by name. That is why in the case of association we
should use a different Storage type that does not build a cache.
Cheers,
Doru
On Wed, Sep 18, 2013 at 5:05 PM, Diego Lont <diego.lont(a)delware.nl> wrote:
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
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Every thing has its own flow"