Ever think, which design pattern was most used OR even better, should I use an abstract class or an interface ?


Busy with relocation, just got my internet connection working :).

One interesting topic I always wanted to read on the net was about which design patterns are the most famous and I wanted to avoid discussions and articles that have “depends on situation”. I just cant accept that answer, depends.. :). So here is my take on last 6 years of its use.

Strategy pattern is the most used. Yeah! Yeah! you will argue on the MVC, but come on have you actually implemented the MVC, no you haven’t in true sense. What you have implemented is the MV model, not the C. You may have used the MVC implemented by frameworks right? So don’t give me that argument. And yes, don’t even start about the Singleton, if you have used it, you will know the lesser you have and lesser you need pattern in a product. I mean how many singleton’s can you or will you or should you have in an application right ?

Strategy for me is fantastic use of future growth, re-usability and abstraction. The question that I had was, is it better to use an interface or an abstract class when implementing the Strategy pattern? The answer is simple, if you have future growth needs for your customizable design, you will most definitely have come common behaviour for each of those who are sharing the signature, so use of interface is lame. I would always use an abstract class. Now lets see you debate that.. 🙂 Comments please.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s