Smokin’ the decorator pattern with Groovy

2008年07月31日 15:07 • 查看 20 次 • 打印本文

I recently found myself needing to add additional hip behavior to an object that handled feed parsing– i.e. I needed to add a series of filters (such as location and price) to the items being obtained from the feed. Of course, the easiest (and probably the most naive) way to achieve such a goal is to have added a few conditionals to the feed parsing object itself; however, I realized that this particular problem already had an answer to it– the decorator pattern.

查看原文 »

评论

发表评论