Re: UML Question (Object <-> ObjectFinder?)
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Sun, 12 Jun 2005 18:20:05 GMT
Responding to Deus...
uh... why would there be hierarchical dependencies in my design?? The [UserFinder] just delegates all method calls to the proxy, and nothing more. I could even use an interface here.
Then why not talk directly to Proxy?
Let's assume a simple persistence access mechanism via a high-level interoperability interface driven by command strings. In the persistence access subsystem we have a subsystem interface method findUserByName. It dispatches to UserFinder.findUserByName, which, in turn, creates the right command string and invokes Proxy.doIt(string). Why do you need UserFinder to do that? The findUserByName subsystem interface method could form the command string and invoke Proxy.doIt directly.
Uh, as I previously showed, there is no command string in the Proxy or anything similiar to it. Instead, the findUserByName is directly mapped to UserProxy.findUserByName, which invokes the FindUserByName procedure in external system. And entities like Order and Computer would have completely different procedures to call in the external system (i.e. there is no general method like FindObjectById or DoIt)
It was just an example of the point. Since I don't use CORBA or Java and I don't know what level of abstraction your local infrastructure handles interoperability, I can't use a specific example.
The issue I have is with who calls UserProxy.findByName. I am arguing that it should not be an object like [UserFinder]. That is, the client should not invoke a UserFinder.findByName method that, in turn, invokes UserProxy.findByName. Instead the client should invoke UserProxy.findByName directly.
[I am also arguing that [UserProxy] should be encapsulated in a subsystem whose interface has a findUserByName method that hides UserProxy. That interface method would understand users vs. orders and would dispatch to UserProxy.findByName. Since UserProxy is already dedicated to users it just needs a findByName method, which underscores the mapping in semantics between the client in the main solution and the actual access implementation within the subsystem.]
The justification for [UserFinder] is one of two things. One possibility is that it does a lot more than just form a string and invoke Proxy.doIt with the string. That is, it coordinates activities like selecting the right external system, opening a socket for the proxy, etc. In that case it is a high level node in a hierarchical functional decomposition tree because it is synchronizing other activities in other objects. This was my concern; it sounded like UserFinder was a god object managing the entire process of accessing the external systems.
The second possibility is that UserFinder is a convenient catch-all for a bunch of variants (findUserByName, findUserBySSN, ...) on a single theme, finding a user based on identity of one sort or another. While that isn't hierarchical, it is essentially making a function a first class object. So one would be better off allocating the function to a problem space entity that would logically have that responsibility (e.g., User or Proxy).
For [User], it's the second. But one of my main concerns is to ensure a consistent interface for frontend objects to access the system core ([object] & [objectFinder]). If I let them use the Proxy directly, the consistence will probably be broken in the future, as there will be different kinds of entities.
Then the frontend objects should access a subsystem interface that hides the actual access mechanisms, like Proxy. IOW, the last paragraph of my point above.
************* There is nothing wrong with me that could not be cured by a capful of Drano.
H. S. Lahman hsl@xxxxxxxxxxxxxxxxx Pathfinder Solutions -- Put MDA to Work http://www.pathfindermda.com blog: http://pathfinderpeople.blogs.com/hslahman (888)OOA-PATH
.
- Follow-Ups:
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- References:
- UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- From: H. S. Lahman
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- From: H. S. Lahman
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- From: H. S. Lahman
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- From: H. S. Lahman
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- From: H. S. Lahman
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- Re: UML Question (Object <-> ObjectFinder?)
- From: H. S. Lahman
- Re: UML Question (Object <-> ObjectFinder?)
- From: Aquila Deus
- UML Question (Object <-> ObjectFinder?)
- Prev by Date: Re: UML Question (Object <-> ObjectFinder?)
- Next by Date: Alright you brainiacs...
- Previous by thread: Re: UML Question (Object <-> ObjectFinder?)
- Next by thread: Re: UML Question (Object <-> ObjectFinder?)
- Index(es):
Relevant Pages
|