3 ms·
The "Conditional Inherited Modules" seems to be one (of many) possible implementations of the venerable Strategy pattern from GoF (http://en.wikipedia.org/wiki/
by josephruscio 16y ago
The "Conditional Inherited Modules" seems to be one (of many) possible implementations of the venerable Strategy pattern from GoF (http://en.wikipedia.org/wiki/Strategy_pattern http://en.wikipedia.org/wiki/Strategy_pattern). It's a really elegant and one of my favorites. Just define a clean interface and pick between different implementations at runtime.
- tomjen3 16y agoThats funny, the Strategy Pattern has always felt like a hack to work around Javas Fucking embarrassing lack of closures.
- josephruscio 16y agoGoF wrote about the Strategy Pattern (and the rest of them) in 1994, so I'm pretty sure Java (first public release in 1995) was the least of their concerns at the time. And believe it or not, there are times when languages with closures are not an option.