Question

I have a class named car and it is a child class of vehicle. Now I want to create an UML class diagram of car without having to draw vehicle and pointing a derivation arrow to it. I want all the derivation information directly in the car class diagram.

Does a notation for that purpose exist in UML?

Best regards,

Cookie

Was it helpful?

Solution

I think it is not possible to indicate that Car inherits from Vehicle while not drawing Vehicle, but note that you can omit the information that is not relevant. In this case, since you are modelling Car, you may omit the attributes and operation compartments of Vehicle, like this:

enter image description here

The UML specification gives the following guideline: "show full attributes and operations when needed and suppress them in other contexts or when merely referring to a class and says that "any compartment may be suppressed. A separator line is not drawn for a suppressed compartment. If a compartment is suppressed, no inference can be drawn about the presence or absence of elements in it." (UML Superstructure Specification, v2.4.1; pag 50 and 54).

OTHER TIPS

The proper way to represent this is a generalization link. But depending of your tool, you may have this kind of information inside another window...

Draw two diagrams, on the first one draw generalization relationship between classes and on the second one draw classes only to design your models.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top