Difference between revisions of "UML"

From BITPlan Wiki
Jump to navigation Jump to search
Line 19: Line 19:
 
=== Inheritance ===
 
=== Inheritance ===
 
* [https://stackoverflow.com/questions/53782241/class-diagram-uml Class diagram UML]
 
* [https://stackoverflow.com/questions/53782241/class-diagram-uml Class diagram UML]
 +
When implementing inheritance there is usually some cost involved in terms of extra classes, tables, documentation and other results that need to be created after the decision to use inheritance.
 +
 +
Inheritance is about special and general cases. First you might want to ask what is the difference between the cases - (called a discriminator). In your case it is the type of reservation and you could avoid the inheritance by modelling this type of reservation and implementing the different behavior based on the reservation type. That would lead to a design like:
 
<uml>
 
<uml>
 
hide circle
 
hide circle
Line 30: Line 33:
 
name
 
name
 
}
 
}
 +
==== Avoiding inheritance ====
 
class Regular_Reservation {
 
class Regular_Reservation {
 
start:date
 
start:date

Revision as of 10:27, 15 December 2018

Tools

Stackoverflow Tags

  1. argouml
  2. magicdraw
  3. enterprise architect
  4. rational rose
  5. umbrello
  6. umlet
  7. visual paradigm
  8. staruml

Tool-Evaluations

Stackoverflow Questions

Inheritance

When implementing inheritance there is usually some cost involved in terms of extra classes, tables, documentation and other results that need to be created after the decision to use inheritance.

Inheritance is about special and general cases. First you might want to ask what is the difference between the cases - (called a discriminator). In your case it is the type of reservation and you could avoid the inheritance by modelling this type of reservation and implementing the different behavior based on the reservation type. That would lead to a design like:

Learning UML

UML-Day