Mathematica: Webel: ADT pseudo classes: TIP: Prefer the Decorator Pattern over multiple inheritance of ADT-Method UpValues! (But not because "inheritance is evil", it isn't.)

Webel IT Australia promotes the amazing Mathematica tool and the powerful Wolfram Language and offers professional Mathematica services for computational computing and data analysis. Our Mathematica tips, issue tracking, and wishlist is offered here most constructively to help improve the tool and language and support the Mathematica user community.
DISCLAIMER: Wolfram Research does not officially endorse analysis by Webel IT Australia.
Icon class
icon_class
far fa-sticky-note
icon_class_computed
far fa-sticky-note
Note kind
Policy level
Keywords
To see why visit: There are other alternatives to the Decorator Pattern, and without nice annotation support (compare with JavaEE/JakartaEE @Decorator) it's a bit tedious, but it's (mostly) safe, and you can sometimes do useful things as you decorate (instead of pure delegation to the wrapped delegate), which is equivalent to an inheritance override. Dr Darren says:
I'm working on a way to generate Decorators in Mathematica for the Webel ADT recipe.

BTW: Inheritance in OO is NOT intrinsically, per se, "evil"

Dr Darren says:
If you have half-read (only) the GoF Design Patterns or you've heard just a little (only) about the Decorator Pattern and then presume to lecture other programmers on the "evil" of inheritance, I recommend you do read (all of) 'Head First Design Patterns', and especially the bit where the "Patterns Guru" Grasshopper explains that the Decorator Pattern is a useful alternative to inheritance in OO coding languages especially FOR BEHAVIOUR and when you need run-time flexibility FOR BEHAVIOUR.

BTW: In the Wolfram Language with this Webel ADT recipe you can generate what would in most other mere coding languages be static hierarchies when and as you like.

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