
Originally Posted by
constv
Thanks Robert. The associations between the nodes can be changed on the fly, added, removed, etc. Also, nodes will be added and removed. It is a fairly complex set of requirements. And there's no way we can cache the complete data for each object. We don't have to. The consideration was to cache the "node" objects that are especially created for traversing only. They would contain only the element's ID and the IDs of its direct associations + some basic data that is necessery to make a decision whether the node must be filtered out of the resulting topology returned. We won't need the complete element data when traversing the graph.
The method that I am thinking of intercepting is only intended to return the next node object in the graph, not a result of a complex calculation. So that should be ok. However, what I don't like about this is that, ideally, that "node object" should not be exposed to clients of the service via a public method since it is not the actual domain object but rather (should be) a service-specific object that exists to assist the internal traversal "under the hood." So, for that reason, you may be right, declarative method interception may not be a good thing in this case.
Thanks,
Constantine