Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Create" vs "Instantiate" dependency in UML

Tags:

uml

According to the UML spec we can denote a dependency between two classes by means of <<Create>> or <<Instantiate>> stereotypes.

Do you know what is the differences between those stereotypes?

It is written in UML spec 2.5 (chap. 22.3 Standard Stereotypes):

  1. For <<Create>>

    A usage dependency denoting that the client classifier creates instances of the supplier classifier

  2. For <<Instantiate>>

    A usage dependency among classifiers indicating that operations on the client create instances of the supplier

like image 209
Vitaly Avatar asked Oct 19 '22 00:10

Vitaly


1 Answers

Michael Jesse Chonoles Yes, «create» is used on sequence diagrams. It's a stereotype on a message. «Create» is also a stereotype on a behavioral feature in a classifier indicating that is a constructor of instances of that classifier (or the equivalent for non-object-oriented items).

When «Create» is used on a dependency, it doesn't seem much different than «Instantiate». Personally, I use the dependency «Instantiate».when I mean a true object-oriented instantiation arrived at by calling the constructor (which is how the I would translate the model into code). I would use «Create» when it's a different kind of creation, either more indirect, conceptual, or non-object-oriented features.

Here are some examples. I would use «Create» to say MSWord-->«Create» a Document, a modeler «Create» a model. Though I normally wouldn't model this in detail, I would use «Create» to indicate a component «Create» a new database record, the database manager «Create» a new database, a programmer «Create» a new app. Or create a new element in a (non-oo) array. These can happen without directly calling a traditional object-oriented constructor -- and can't be directly converted to code.

On the other hand, if I had a marriage operation on a person, it would probably «Instantiate» the association class object of marriage.

Because most of my modeling is conceptual, in practise, I tend to use «create». Though, even then it doesn't come up that often.

like image 170
Michael C Avatar answered Oct 22 '22 21:10

Michael C