Re: Managing multiple instances



Yes, falling apart would not surprise me. This is a real architectural
problem because the structure is being hard-wired into object
implementations. The proper OOA/D way to handle this is through
peer-to-peer relationships.

So even if the relationship is a "has-a" it should be implemented in
terms of collection rather than hard coding in a reference attribute?

All you then need is some way for the clients to know how to ask for a
specific instance of [C] and/or [A]. But you already have that problem
because the client needs to use the right hard-wired numbers. That
implies some context the client understands that can be mapped into
whatever new identity scheme you employ.

That is the crux of my whole problem, managing an identity when objects
being identified are attributes of other classes. There is more than
one instance of a class created in different context and keeping the
identity unique enough for client code to correctly request the
appropriate object from the data structure. I need something unqiue
that will not change if the rest of the system changes.

As it happens, an OOA/D model might look this way even for your existing
structure. The difference lies in the way the collections are
hard-wired now within objects vs. the separation of concerns for the
rules and policies of access, which should be in some other "factory"
object that manages instantiation of [A], [B], and [C] instances and
their relationships. The difference would also be reflected in the way
one navigates the relationships for collaboration.

So if I read this they way you intended, you are recommending a factory
or builder to do the initial creation of all objects rather than
allowing objects that contain other objects do the creation?

Thanks for your time,

Ben

.



Relevant Pages

  • Re: Abstract factory and remoting
    ... made the Factory local to the Client. ... AbsServer - ... Factory - not remotable anymore, invokes the remotable Servers ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Run-time loading assembly on Server RO question
    ... factory ever needs to load the assembly for the RO it's creating the proxy ... That should create a proxy and return it to the client. ... > xml info so our Factory know where/how to load their object. ... I'm not sure of the purpose of the three different assemblies. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Software design patterns: encapsulation & object identity
    ... > constructs, maintains, and issues GOF Singleton instances of a Widget. ... > Clients of the Factory instance obtain the Widget Singleton instance ... instantiating client, can know that the factory creates singletons. ...
    (comp.object)
  • Abstract factory and remoting
    ... The Servers are remotable objects hosted in IIS. ... Factory (concrete remotable Factory - contains references to ... Client ... configuration file is: ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Opinions on the Law Of Demeter
    ... Have the client operate on a simple, existing connection. ... > the calling method must construct a new factory instance with the existing ... context of the above example I can go...... ...
    (comp.object)