Visual Pointers to huge domain objects
In a rich-client application connected to a server it is important to reduce communication bandwith. In an client application users often edit a single domain object in a window. But this domain object can have many dependencies to other domain objects. Or if the window has a master/detail layout the user sees many domain objects but is only interested in the details of a single object. If the application loads all data upfront or all dependencies as complete objects even if only a single visual attribute is needed. The application will behave slow and ugly.
To solve this problem the reference concept from C++ can be used. Instead of passing the complete object only references are passed around for dependencies or small amount of information from domain objects. In this case the reference must contain at least as much information as possible to identify the domain object. But who is responsible for creating the reference and converting the reference to a complete object if needed?
In my opinion the reference should be created by the domain object itself, because the domain object knows how much information is needed to identify itself. Also if we go along the domain driven design road the repository might also be able to create references otherwise a client has to load the complete object to get a reference which doesn’t provide any performance boost. Also the repository is the candidate for loading the domain object from a reference.
Having this approach a small adition of a single visual attribute or a map of visual attributes provides a better performance than having the complete domain object ever and ever.