Using Java, I have a very large object graph where an object is associated with many other objects each of which is associated with yet many other objects. Most of the time I just need a sub-graph to pass on to a method or send across a network.
Is there a recommended design pattern so I can truncate this large object graph at many points in the graph. One way would be provide NULL as reference at all points of truncation. I'd appreciate any other ideas.
Thanks
If I understand you correct, you could use Lazy Factory.
This strategy is commonly used when mapping object with associations which you do not need right now, and may not need at all. (It is widely used in Hibernate ORM).
When you want to send large objects accross a network you can use Proxy Pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With