Re: How to express conditional dependency between components in UML?
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Fri, 27 May 2005 16:07:48 GMT
Responding to Riipinen...
How would one express a conditional dependency between two components in UML (2.0) component diagram?
This is the situation: Component A (an executable) uses Component B (a DLL) by dynamically instantiating a class from it but only if certain programmatic parameter, PAR1, is set to value TRUE. The value of the parameter is stored into an .ini-file that is read by Component A on startup. If PAR1 is FALSE or missing, Component A doesn't need Component B at all. There is no static reference from Component A to Component B, everything is done dynamically.
Why use a dependency at all?
* 0..1 [A] ------------------- [B]
When an [A] is created the factory can look up PAR1 and instantiate the association as needed. IMO that does the best job of encapsulating the relevant policy. [I am somewhat biased because dependencies are not part of the MDA profile that I use. B-)]
Alternately, you can attach an OCL constraint to the dependency to explicitly show the effect of PAR1.
************* 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
.
- References:
- How to express conditional dependency between components in UML?
- From: Petri J. Riipinen
- How to express conditional dependency between components in UML?
- Prev by Date: Re: Intellisense and the psychology of typing
- Next by Date: Re: Intellisense and the psychology of typing
- Previous by thread: Re: How to express conditional dependency between components in UML?
- Next by thread: Re: How to express conditional dependency between components in UML?
- Index(es):