Re: UML notation question...

From: Shashank (shashank_at_icmgworld.com)
Date: 05/19/04


Date: Wed, 19 May 2004 22:35:00 +0530

How much should the identification of classes (different roles of employee is
identified as different classes here) be blamed for these un-resolved complexity in
relationship?

regards,
Shashank

"H. S. Lahman" wrote:

> Responding to Hartley...
>
> > Suppose I have the following situation :
> >
> > an A must be either a B or a C
> > a B might be a C (or vice-versa), but might not.
> > However, B's and C's are all D's.
> >
> > Is UML expressive enough to capture fully all the above information? If so, how??
>
> You can't get there from here, but the problem lies in the way the OO
> is-a relation is defined, not with UML. The problem is your second
> specification line.
>
> An OO is-a relation is essentially a Venn Diagram in tree form.
> Subclasses represent complete subsets of the superset. OO
> classification defines set participation based upon the collection of
> properties for those sets. So
>
> [A]
> A
> |
> +---------+-----------+
> | |
> [B] [C]
>
> is just fine for your first specification. The problem is that an OO
> superclass also represents the intersection of shared properties for all
> set members. That means [B] and [C] describe disjoint sets of
> properties. Therefore a B is always an A and a C is always an A but a B
> can never be a C.
>
> Similarly, your last specification could be described as:
>
> [A]
> A
> |
> +-------------+
> |
> [D]
> A
> |
> +--------+---------+
> | |
> [B] [C]
>
> Now all Bs and Cs are Ds and they are also As. The problem here is that
> [D] is superfluous. Because the union of subsets must be a complete set
> of [A] and there is no other direct subset of [A] than [D], that makes
> the [D] set identical to the [A] set.
>
> However, you can get close to what you want for the first and last
> specification using multiple is-a relations /IF/ the common properties
> reflect different sets of properties for [A] and [D]. Then one can have:
>
> +-- [B] --+
> | |
> | |
> [A] <|------+ +-----|> [D]
> | |
> | |
> +-- [C] --+
>
> where both [B] and [C] each belong to two different is-a relations, one
> for [A] and one for [D]. However, a B is still precluded from ever
> being a C.
>
> [Even this fails as indicated unless [A] and [D] are joint sets for the
> participants. That's because if both [A] and [D] have exactly the same
> subsets, there is no reason to separate them for reasons similar to
> those I used above for [D] inheriting from [A]. There is an excellent
> discussion of such exotica in Leon Starr's "Executable UML: How to Build
> Class Models", which IMO is the best book available on practical OO
> class modeling by a large margin.]
>
> So one can't express exactly what you want in traditional is-a
> relations. However, your second specification is actually fairly common
> with the most obvious example being roles. That is, an object has
> different behaviors in different execution contexts. This can be
> handled indirectly without [B] and [C] participating in the same is-a
> relation by separating the concerns of the role from the object itself.
> The best example of this is the GoF design pattern called State.
>
> [GoF refers to the Gang Of Four who wrote the classic "Design Patterns"
> book (Gamnma, Helm, Johnson, and Vlissides).]
>
> *************
> There is nothing wrong with me that could
> not be cured by a capful of Drano.
>
> H. S. Lahman
> hsl@pathfindermda.com
> Pathfinder Solutions -- Put MDA to Work
> http://www.pathfindermda.com
> (888)-OOA-PATH



Relevant Pages

  • Re: UML notation question...
    ... >> Is UML expressive enough to capture fully all the above information? ... there is no reason to separate them for reasons similar to ... >Class Models", which IMO is the best book available on practical OO ...
    (comp.object)
  • Re: Flamebait if I ever saw it
    ... just as Lisp and JavaScript do. ... The whole point of functional programming is to be able to reason about the parts of a program separately, in the same way that we can reason about separate mathematical functions separately. ... When you have mutable data in a *dynamic* language you can no longer do this - any function, anywhere in the program, can mutate not just the value of a datum, but it's *type* as well. ...
    (comp.lang.lisp)
  • Re: Database Split and Linked Table
    ... main servers for a number of years without any major problems. ... also for a similar reason to Jeanette that the program was initially ... It is NOT difficult to keep separate FE's updated. ...
    (microsoft.public.access.setupconfig)
  • Re: Input Box selection and file open
    ... lines of data you showed actually on separate lines in the file itself? ... The reason I ask is because when I tried to run your ... >>> Rick you've obviously been working with idiots for too long because ... I repeated the Dim statements. ...
    (microsoft.public.excel.programming)
  • Re: /boot at beginning of drive
    ... I can separate /usr, but my goal is to combine /home and /var, or at least ... there's no reason you can't configure whatever db you're using to store ... the event of a filesystem crash or you get hacked it's much easier to restore ... While there is no "standard" filesystem layout on *nix systems, ...
    (freebsd-questions)