Re: UML: extends .vs.generalize

From: Steve (steve_a_haigh_at_hotmail.com)
Date: 10/15/03


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
~



Relevant Pages

  • UML: extends .vs.generalize
    ... difference between extends and generalize. ... college student application. ... the extension was "enroll foreign ...
    (comp.object)
  • Re: UML: extends .vs.generalize
    ... >>college student application. ... > generalization, but you and your friend seem to be talking about 2 ... > Family Member as a generalisation of student is helpful, ... It's supposed to be "Enroll Family Member". ...
    (comp.object)
  • Re: Microsoft OneNote [ignore if you have no interest in philosophizing about how humans organize d
    ... > I thought to get the academic price you had to be either a student or a ... Basically any K-12 student or homeschool student, any college student, ... any faculty member, and any family member of one of those. ...
    (sci.med.transcription)
  • Re: The Future of Physics and the World
    ... major problems: the site is way too small for anything on the ... the policy of that or any campus, alumnus sites aren't supported ... any longer and I'm not a student or faculty member there any longer. ...
    (sci.physics)
  • Re: OT: I wanna be a scientist
    ... >approaching a faculty member about lab work, ... There are different types and categories of lab worker. ... straight technicians who work in labs and are paid by the hour. ... If you are a graduate student and want to do your graduate research in ...
    (talk.origins)