Decorator pattern

25 views
Skip to first unread message

The Beez

unread,
Dec 29, 2016, 12:39:42 PM12/29/16
to 4tH-compiler
Hi 4tH-ers!

If you think that 4tH's entire Object Orientation is based on a simple 2K preprocessor file, you might imagine that I'm always curious to see if it succeeds or fails to comply to so called OO design patterns. Well, I stumbled against this one (https://en.wikipedia.org/wiki/Decorator_pattern#Java) and wanted to see if I could replicate it.

In short, it was a breeze to implement - apart from the usual typos - and it worked as advertised. The file is called "FOOSDECO.4TH" and you can have a look at it in SVN: https://sourceforge.net/p/forth-4th/code/1050/tree//trunk/4th.src/4pp/foosdeco.4pp

Hans Bezemer
Reply all
Reply to author
Forward
0 new messages