• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

stereotype

 
Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
people,
what is a stereotype? fowler says we should be confused between one and a constraint. i am confused. why shud i be confused between a constraint and a stereotpye?
can someone care to explain with examples?
v
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UML provides a number of extension mechanisms that allow you to augment UML with additional semantics. These are property lists, constraints and stereotypes.
For most users, the distinctions between these are not really important, and tend to come down to a matter of notation (guillemets vs. angle brackets). From a UML point of view however, stereotypes are vastly different from constraints and properties.
A stereotype is a way of defining extensions to the UML metamodel. From UML1.4 "It provides a way of defining virtual subclasses of UML metaclasses with new metaattributes and additional semantics." Modellers can define new stereotype classes in the UML metamodel layer (extending the semantics of the metamodel), then use these in their application models. This is done by 'attaching' the stereotype to existing classes - using the guillemet notation. So - while we are using stereotype classes in our application models, they actually belong to the metamodel layer above/below (depending which way up you hold the UML layers).
As UML makes clear - you do not need to define stereotypes just to add some additional class semantics. Constraints or tagged values will often suffice (e.g. persist=true).
In my experience, I tend to use stereotypes and constraints quite flexibly. If a stereotype already exists (see the end of the UML spec), then I will use it. If not, then I might add a new stereotype to show a particular usage like a design pattern. However, I have never actually gone to such lengths where I provide a stereotype definition. I just do not see the need for such precision and completeness in my every day modelling tasks.
So...this was a rather long-winded way of saying that stereotypes and constraints are very different, but most people do not care about the differences. But Fowler put it better I think.
regards,
paul.
 
vasu maj
Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks paul. i got the point.
-v
 
Don't listen to Steve. Just read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic