Book a Demo

Author Topic: How to Model Supertypes and Subtypes?  (Read 16306 times)

David Wagoner

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to Model Supertypes and Subtypes?
« on: July 11, 2012, 12:14:04 am »
The EA User Guide is pretty light on the documentation for modeling supertypes and subtypes, so I need a link to better documentation, a demo, or feedback on how to model these in EA.

I see how to change the Association properties to Generalization.  But, creating a new Generalization Set is not completely clear.  What is a Power Type, for example?  What controls which entities show up in the IsMember list?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to Model Supertypes and Subtypes?
« Reply #1 on: July 11, 2012, 04:15:19 pm »
In general a subtype has a Generalization relation to a supertype.
In EA you just model them as a Generalization relationship (has nothing to do with an Association)
I guess you could also consider Realization for the subtype/supertype thing.
AFAIR GeneralizationSet is a rather exotic construct to group different classes into separate Generalization hierarchies.
Unless you are absolutely sure you need this, I would try to forget you ever heard of it. (KISS ;))

Geert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How to Model Supertypes and Subtypes?
« Reply #2 on: July 11, 2012, 05:12:39 pm »
An example to help understand Generalization Sets... The superclass Animal might have subclasses Fish, Bird, Reptile, Male and Female. You will notice straight away that the first three belong together, and the last two belong together. To show this, you might create two generalization sets named "Taxonomy" and "Gender" and assign each generalization to the appropriate set. Alternatively, you might take Geert's very good advice :)
The Sparx Team
[email protected]

Michael Hafner

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
Re: How to Model Supertypes and Subtypes?
« Reply #3 on: July 30, 2012, 06:56:54 pm »
A more formal approach to powertypes: "The notion of power type was inspired by the notion of power set. A power set is defined as a set whose instances are subsets. In essence, then, a power type is a class whose instances are subclasses. The powertypeExtent association relates a Classifier with a set of generalizations that a) have a common specific Classifier, and b) represent a collection of subsets for that class." (From UML Superstructure 2.3, p. 72 at http://www.omg.org/spec/UML/2.3/Superstructure/PDF/)

Discussion about PTs from the forum: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1318079135/6#6

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to Model Supertypes and Subtypes?
« Reply #4 on: July 31, 2012, 11:53:27 am »
Quote
[size=18]...[/size]
Unless you are absolutely sure you need this, I would try to forget you ever heard of it. (KISS ;))

Geert
I find Generalization Sets very useful in conceptual modelling - especially at enterprise level.  Unfortunately EA's (and - for that matter UML's) support for Generalization Sets is less than optimal.

As for KISS...  In principle, it is a good idea - however, I prefer the Einsteinian dictum:  "Keep things a simple as possible - BUT no simpler!"   Most people never get as far as the second clause...

So they start off with the somewhat simplistic - "Keep it simple, stupid" and end up with "We kept it simplistic".

And to add insult to injury most people don't understand what "simplistic" means in the first place!

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