Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a UML profile diagram and when is it used? [duplicate]

I have been reading about the UML Profile Diagram but I don't understand it. I want to mainly understand when it can used.

like image 598
Abdelrahman Gamal Avatar asked Nov 21 '25 20:11

Abdelrahman Gamal


2 Answers

Actually there is no special UML diagram. All UML diagrams are equal - but some are more equal than others. UML diagram categories were introduced to contain mainly (but not forcibly) elements of a certain area. Well known are use case and class diagram (and a couple more).

Now, a profile in UML is used to define stereotypes and possibly stereotype properties going along with them. A stereotype "extends" meta elements defined in UML (like classes, use cases, etc.) or other profiles, this way building new meta types.

You do that to model certain domains and give the modeler specific new elements. E.g. you can define a profile for a car manufacturer and introduce stereotypes like <<motor>>, <<chasis>> and so on. So these are business objects with a well know semantic in that domain. A motor could go with stereotype properties like type being an enumeration of gas, electric, etc. There are a couple of pre-defined profiles published by OMG (and other authorities) like SysML, BPMN, etc.

A profile diagram (from a tool perspective) would offer you meta classes, handles for stereotype properties and specific connectors like Extends to ease creation of new profiles.

like image 93
qwerty_so Avatar answered Nov 24 '25 22:11

qwerty_so


A profile is a special kind of package that allows you to extend UML. The profile diagram is a structural diagram that explains these extensions using meta-classes, so the classes that are used to define UML itself.

Look for example, how the standard profile defines the stereotypes of a component diagram:

enter image description here

You will certainly remark the black arrow, which looks like a generalization but with a filled head. They mean an extension of an UML metaclass. So, here an UML component can be extended with a stereotype «Entity». Like all UML diagrams, the diagram doesn't show it all. So you'd have some definition of what the stereotype is.

You can find an practical example in this profile diagram that defines EJB stereotypes, which can be useful if you model a lot of EJB based designs. You can in the same way define a more specialised profile if you do specialised modelling.

Another example of use for UML profiles is to define the basic types of a programming language. For example, if the UML primitive types Integer and Real are not what you want, you can very well define the following primitive types in your own profile:

enter image description here

Profiles even allow you to associate a graphical icon with an element.

like image 44
Christophe Avatar answered Nov 25 '25 00:11

Christophe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!