Re: UML: extends .vs.generalize
From: Steve (steve_a_haigh_at_hotmail.com)
Date: 10/15/03
- Next message: Phlip: "Re: Question about removing duplication: inheritance vs static methods"
- Previous message: Wayne Dernoncourt: "UML: extends .vs.generalize"
- In reply to: Wayne Dernoncourt: "UML: extends .vs.generalize"
- Next in thread: Wayne Dernoncourt: "Re: UML: extends .vs.generalize"
- Reply: Wayne Dernoncourt: "Re: UML: extends .vs.generalize"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 15 Oct 2003 13:34:59 +0100
On Wed, 15 Oct 2003 11:40:34 +0000 (UTC), Wayne Dernoncourt
<wayned@panix.com> wrote:
>My officemate and I were talking about "UML Style Guide"
>yesterday and he asked if I knew and understood the
>difference between extends and generalize. I said that
>extends is part of inheritance while generalize is the
>opposite. According to Mike, he said that I was wrong
>according to the book. According to the book, the two
>terms are almost identical.
>
>The example used to illustrate the terms involved a
>college student application. The base class was
>"enroll student", the extension was "enroll foreign
>student" since the foreign student may have to have
>additional paperwork & steps. The "generalization"
>was "family member" (I believe a family member of
>an alumni or an active student, but I could be
>mis-interpreting and/or mis-remembering stuff).
>
>I could see the student not needing all of the steps
>(maybe, maybe not) of a non-family member.
>
>Am I missing something here?
Sort of... The term Extends applies to Use Cases and the term
Generalize applies to class heirarchies. Extending a Use Case is a
form of specialization, and is therefore the opposite of
generalization, but you and your friend seem to be talking about 2
different things. You are correct in saying they are the opposite of
each other, but from your examples I think you are perhaps applying
them in the wrong way.
I think the example you give is for a Use Case not a class - "Enroll
student" sounds to me likea use case. Eroling a foreign student makes
use of all the normal enroling but also needs someting extra (visa
application maybe), hence the Use Case for Enrol Foreign Student is an
extension of the basic Use Case.
Family Member sounds like a class, and as such could be part of an
inheritance heirarchy. In a real system I can't see how modeling
Family Member as a generalisation of student is helpful, but if you
really wanted to you could say a student is-a family member, and in
turn a family member is-a person.
A better example might be faculty member. Let's say a student must be
be a faculty member, so to is a teacher and an administrator. They may
all have some things in common, such as they all have a mail box in
the faculty, or they all have an ID card - you could extract these
attributes and put them in a Faculty Member class which is a
generalization of student, teacher and administrator. This is only a
toy example, in the real world I would model this differently, but
that would only complicate things here.
Hope this helps!
Steve
~ If emailing, please use: Steve_A_Haigh
~ @
~ hotmail.com
~
- Next message: Phlip: "Re: Question about removing duplication: inheritance vs static methods"
- Previous message: Wayne Dernoncourt: "UML: extends .vs.generalize"
- In reply to: Wayne Dernoncourt: "UML: extends .vs.generalize"
- Next in thread: Wayne Dernoncourt: "Re: UML: extends .vs.generalize"
- Reply: Wayne Dernoncourt: "Re: UML: extends .vs.generalize"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|