movie rental service
movie downloads.

Using the Decorator Design Pattern to Create a Dynamic Community

July 15, 2007 – 2:04 pm

As ThemBid.com grows, we have received several requests to create communities that use ThemBid.com as the underlying engine, but niched to a certain vertical. Normally we would create this new community using a set of core classes and then an array of sub classes specific to each community. But I want to have some web 2.0 fun!

The Decorator design pattern allows us to implement sub classes dynamically. This allows for some interesting possibilities for evolving social networking communities dynamically. For example, you could implement an algorithm that gauges the popularity of various features and then change the layout and functionality of the site based on that data without touching the code. The Strategy design pattern would be a good candidate for implementing the algorithm, since it offers the flexibility of easily plugging in and removing algorithms at will.

For low traffic sites with not much data, this approach may not make sense, but for high volume traffic sites such as Digg.com this kind of approach would create some interesting scenarios (I’m thinking about the commenting system). Of course, you would implement some moderation features; but at the end of the day, if you have a significant volume of traffic you probably will not suffer too much damage having your application morph to the needs of the majority of its users.

Do you have some thoughts on implementation? I’m thinking Symfony or Ruby on Rails.

Post a Comment