When domain modelling with SysML, Generalization, inheritance, and even multiple inheritance are not "evil" and can be used relatively freely. We are not doing code-oriented Decorator patterns - an implementation choice - we are doing domain modelling!

Icon class
icon_class
far fa-sticky-note
icon_class_computed
far fa-sticky-note
Note kind
Policy level
UML keywords
Keywords

Dr Darren says, "now, repeat after me":

The Decorator Pattern is a good option (only) for run-time encapsulation of variations of behaviour in certain implementations, not a replacement for inheritance in domain modelling. Domain modelling. Domain modelling!

Ever had some fool ask you about inheritance in a job interview and offer up the Decorator Pattern as the complete replacement (because they only understood half of the story)? Be lucky you failed their "test" and aren't working under them. Then go and work for someone who knows about Systems Modeling Language (SysML®) instead!

Relates to
Related notes
Related notes (backlinks)
Related snippets (extracts)
Visit also
Visit also (backlinks)