3 ms·
Publisher/subscriber and composite patterns had the greatest impact on the quality of my code, apps that are composited from small decoupled parts are much easi
by jarek-foksa 14y ago
Publisher/subscriber and composite patterns had the greatest impact on the quality of my code, apps that are composited from small decoupled parts are much easier to reason about.
I'm also using delegate and prototype patterns a lot, though those are rather dangerous when misused. Deep inheritance chains or excessive method overrides can easly make the code unmaintainable.
- era86 14y agois this different from the observer pattern? which languages do you program in?
- jarek-foksa 14y agoI'm not aware of the observer pattern. I'm using CoffeeScript and my implementation of pub/sub is here https://gist.github.com/4489352 https://gist.github.com/4489352 Sample usage: button = toggleOn: -> @trigger 'toggled', 'on' window = init: -> button.listen 'toggled', (buttonState) => @showWindow if buttonState is 'on'