Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UML Question

 
Muhammad Asif
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mark a class as abstract, is that a constraint or a stereotype? The current official documents call it a constraint. Why is this so ?

Shouldn't it be a stereotype, as an interface is.
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A stereotype is a modelling construct that is not there in the UML, but close to something that is there in the UML. This definition fits an interface. An interface is something similar to a class, but not exactly the same as class. Hence you can call an interface as a stereotype of class.

Now look closely at this definition of stereotype. Can it be applied to abstract class? No. Because an abstract class IS a class. Hence it is a special form of a modelling construct that is ALREADY THERE in the UML - namely class. You are not talking about a modelling construct outside of core UML, instead, you are talking about a construct that is already part of core UML - ie class, but with a constraint that it needs to have atleast one abstract method.

That said, stereotypes and constraints are almost similar. Because stereotypes are more constrained. For example, an interface is more constrained than its stereotype counterpart - class in the sense that all operations on an interface need to be abstract operations.

Don't be too concerned about these details for SCEA. I heard questions are very basic from UML. Just know the notation for interface and know that it is a stereotype of class

hth,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic