Book a Demo

Author Topic: Generalization Sets  (Read 6618 times)

atw

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generalization Sets
« on: January 17, 2005, 11:14:44 am »
Hello,

Is there any way to group generalization links into sets similar to how Martin Fowler describes it in his book "UML Distilled"?

I know that EA can attach notes or constraints to generalization links.  However, the notation is different than Fowler's method and I do not see if there is any method to report the different types of generalization links that a class may have.

Thank you,

thomaskilian

  • Guest
Re: Generalization Sets
« Reply #1 on: January 19, 2005, 12:38:15 am »
I haven't read Fowler, so I can only guess what you mean by grouping. Could you use a stereotype to represent these groups?

atw

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generalization Sets
« Reply #2 on: January 19, 2005, 05:56:23 am »
Thank you for responding to my question!

First, a generalization set is a group of generalization-type connectors with a common target superclass.  Typically, the subclasses connected with connectors within a generalization set are mutually exclusive subclasses that have a common classification.  

For instance, a superclass "person" can have subclasses: male and female.  A good name for a generalization set for the generalization connectors from these two subclasses would be "sex".  The same superclass "person'" can also have subclasses: doctor, lawyer, accountant, programmer, etc.  A good generalization set name for the generalization connectors for these subclasses would be  "occupation".

To some degree, I can use stereotyped connectors.  However, with a large domain model there will be a lot of different connector stereotypes.  Additionally, the notation would not be as clean as the UML 2 generalization set notation.

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Generalization Sets
« Reply #3 on: January 19, 2005, 01:55:24 pm »
Do you have the spec reference for this?

Quote
Additionally, the notation would not be as clean as the UML 2 generalization set notation.


bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Generalization Sets
« Reply #4 on: January 19, 2005, 02:22:03 pm »
Quote
Do you have the spec reference for this?
UML 2 Superstructure, Section 7.17.3 GeneralizationSet.

We don't have an actual GeneralizationSet element: you would represent one using the tree style connectors and attach a constraint. That may not be enough (specifically the tree style notation doesn't cope when one parent has more than one GeneralizationSet) so we probably need to have a think.
The Sparx Team
[email protected]

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Generalization Sets
« Reply #5 on: January 22, 2005, 06:24:24 pm »
Please, Please...think hard.  I use this a lot in data modeling.
Verbal Use Cases aren't worth the paper they are written upon.

Owl Saver

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • Never give up.
    • View Profile
Re: Generalization Sets
« Reply #6 on: March 02, 2005, 05:56:14 pm »
Please take my comments with the proverbial grain of salt. I have been using Object Oriented Modeling since the early 1990's and have found the approach described below to be intuitive but hard to work with.

Specifically, Sex is an attribute of a person, not a sub type. Doctor, Lawyer, etc. are roles. This is best handled by containership.

The bottom line is to model something as it is. For example, I am a person. I happen to be a Spouse, an Employee, a parent, and many other things at points in time. So, I am a type of person but I inhabit these roles over time.

In my experience, this creates much more resilient systems.

Quote

...
For instance, a superclass "person" can have subclasses: male and female.  A good name for a generalization set for the generalization connectors from these two subclasses would be "sex".  The same superclass "person'" can also have subclasses: doctor, lawyer, accountant, programmer, etc.  A good generalization set name for the generalization connectors for these subclasses would be  "occupation".
...

atw

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generalization Sets
« Reply #7 on: March 03, 2005, 01:30:26 pm »
Thank you for your input!  I actually created my models to follow the methodology as you described.  In the case with person class, I modeled person, relationship, and role.


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Generalization Sets
« Reply #8 on: April 01, 2005, 05:52:38 pm »
>Please take my comments with the proverbial grain of salt. I
>have been using Object Oriented Modeling since the early 1990's
>and have found the approach described below to be intuitive but
>hard to work with.

I've been an Object Modeler since 1978, and a Data Modeler
since the mid 80's.  Yes, you can be both without suffering
bipolar disease! :-)

>Specifically, Sex is an attribute of a person, not a sub type.
>Doctor, Lawyer, etc. are roles. This is best handled by
>containership.
>
The attribute is contained, but as a consequence of having the
attribute value (male/female] the resulting subclass has
different attributes and operations.  This is exactly what the
UML2 Generalization Sets and Powertypes is trying to model (and
it's a great step forward).  In the Data Modeling domain, we're
quite used to these concepts and it was disheartening to see UML
1 didn't support this.  Now UML 2 DOES!

>The bottom line is to model something as it is. For example, I
>am a person. I happen to be a Spouse, an Employee, a parent, and
>many other things at points in time. So, I am a type of person
>but I inhabit these roles over time.

You are quite right, these latter concepts are roles and should
be modeled as such.  In particular, since many of these roles
are dynamic, using static inheritance would be problematic.

>In my experience, this creates much more resilient systems.

This is undoubtedly true...  A correct conceptual model
literally "designs out" whole classes of problems that many
systems suffer from.

Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!