Re: UML "OR" Composition Question
From: Michael Rauscher (michlmann_at_gmx.de)
Date: 05/21/04
- Next message: Mark Woyna: "Re: modeling a use case scenario (activity diagram)"
- Previous message: Mark Nicholls: "Re: object oriented -> structured"
- In reply to: H. S. Lahman: "Re: UML "OR" Composition Question"
- Next in thread: H. S. Lahman: "Re: UML "OR" Composition Question"
- Reply: H. S. Lahman: "Re: UML "OR" Composition Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 21 May 2004 15:41:21 +0200
H. S. Lahman schrieb:
> Responding to Rauscher...
>
>>>> Of course can one X not be a Y _and_ a Z. And I didn't say that.
>>>
>>>
>>>
>>>
>>> Then you will have to explain to me what you meant when you said
>>> "it's wrong that one X must be a Y or a Z." In the original problem
>>> statement X only has two subclasses, Y and Z.
>>
>>
>>
>> One X may be a Y or a Z or even a X.
>
>
> That implies that one can instantiate an X without specifying a
> subclass. Though some misguided OOPLs like C++ allow that, it is a
> no-no from an OOA/D viewpoint. One can only instantiate leaf subclass
Do you have sources for this?
> instances from a subclassing relation. That is, each instance must
> completely resolve the entire tree; otherwise the properties of the
> instance would be ambiguous.
Not "otherwise". The ambiguity would be a result of the claim that each
instance must completely resolve the entire tree. Otherwise :-) there
aren't any ambiguities.
[...]
>>
>> If I understand you correctly, you'd say that because there are
>> subclasses, one must not instantiate X?
>
>
> That is correct, per my comment above.
To me, it's interesting that it is hard to prove/disprove this requirement.
E.g. one may start with a class Exception. In a later version of the
model, this someone needs a specific form of exception, therefore
extending it
[Exception]
A
|
[SpecificException]
Now, you say this is wrong, because Exception is useless in this case. I
guess, that you would model this as something like
[AbstractException]
A
|
+---------+----------+
| |
[Exception] [SpecificException]
So, I'd say from a static view you're right, from a dynamic view, it's
wrong. With static I mean, that one looks at a given (or creates an)
ultimate model. With dynamic I mean, that one extends (or may extend) an
existing model.
The problem is, that there are existing references to Exception. "All"
objects in the old model works with Exception. Therefore, if one
enforces your approach, he has to change all references to Exception
into references to AbstractException.
I'd also say, that one cannot assume an ultimate model. Therefore it
doesn't matter if there are classes, that currently don't exist or if
there are classes, that are simply not shown.
Bye
Michael
- Next message: Mark Woyna: "Re: modeling a use case scenario (activity diagram)"
- Previous message: Mark Nicholls: "Re: object oriented -> structured"
- In reply to: H. S. Lahman: "Re: UML "OR" Composition Question"
- Next in thread: H. S. Lahman: "Re: UML "OR" Composition Question"
- Reply: H. S. Lahman: "Re: UML "OR" Composition Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|