There are tons of interminable debates and controversies around design patterns. The current post doesn’t intend to add a new one or to create waves. It just relates to a few mistakes that are done when comparing “similar” patterns.
From time to time, we organize internal design patterns presentations. Most of the time the presentation format is like this: a guy picks a pattern and presents it, during presentation we ask questions and discuss about it, at the end we compare it with other “similar” patterns and underline the advantages (testing, reusability etc.).
The presenters choose to show real code in order to convince the audience about the pattern and the similarities with other patterns. Even if it is a good practice, the real problem addressed by the pattern will be overlooked if you consider only the code.
When comparing two patterns the audience falls into the sin of analyzing them in terms of classes and responsibilities. This happens because the pattern code was written a few months ago and it’s hard to remember why you decided to use the pattern. Often the pattern intention is in the shadow of the testability and reusability arguments. In this case you might end up with implementing a particular pattern even if the problem claims for another. Therefore in such discussions the focus should be on the intention of the pattern and the problems it resolves.
For instance it is very easy to confuse the Adapter with the Bridge if you are looking only to the code and you don’t know the real intention of such an implementation decision. The purpose of the adapter is to adapt the interface of an existing component in order to simplify or to meet your requirements. The consequence of this is that you don’t access the component directly in the client. On the other hand the role of a Bridge is to vary the implementation. This makes it suitable for plugging specific implementation at runtime. Again the result is the isolation from the client. This obvious consequence makes them easy to confuse. The Adapter is a decision made most of the time during the low level design in order to simplify the integration of third party components. The Bridge pattern is considered up-front (high level design) because you will need it in order to impress a specific behavior to the system more than to simplify the implementation (component integration and isolation).
Here are two scenarios that give you a flavor of how things influence the decision:
1. Let’s suppose that a development team decide to use an existing open-source component with some functionality that will take them too much time to develop. That component has a lot of additional functionality that is not needed and the interface is too complex for using directly. The good decision is to add an adapter between the application and the third party component. This will simplify the interface and will isolate the client code from accessing directly the component. In this case the component already exists and the only concern is how to manipulate it in an easy way.
2. A customer asked to develop a client application for 2 platforms: Windows XP and WinCE. The software company has 3 teams: one that develops agnostic-platform functionality and a team for each specific platforms. During the high level design the architect decided to use the bridge pattern. Each platform team develops a component that is platform specific and which conforms to an interface contract. The common functionality will be developed making the assumption that at some point the specific platform functionality will be provided. The bridge shouldn’t be thought as a middle man because it can mix the interface operations and maybe custom functionality to provide consistent services to higher levels.
As a conclusion when comparing similar patterns first consider the purpose of the pattern before drilling into implementation details. It will be very hard to make a clear distinction using only code samples and ignoring the intention behind that.


Hey appreciate you text this post. I enjoy blogging!
it’s very usefull for me thanks
Hi there Webmaster, If you’re interested in making money from your blog and driving thousands of free visitors to your website then i will show you a secret way to build a Blog Empire that earned over $1,107,693! Just check it out now: http://tinyurl.com/new-blogging-system
I REALLY liked your post and blog! It took me a minute bit to find your site…but I bookmarked it. Would you mind if I posted a link back to your post?
Proper content pieces & Great a site….
Exactly where could it be, i’d like to read much more about this posting, thank you.
There are those who argue that we should not move forward with ugg boots for sale any other elements of reform until we have fully sealed our borders,” he said. “Our borders are just too vast for us to be able to solve the problem only with fences and border patrols. It won’t work.
Can wii play gameboy games? I’m wanting to play pokemon green, red, blue and crystal version… Is there any wii or gamecube games like them??
Hi, It reminds me a joke i’ve heard yesterday. As the moral is closely the same! =) A dude in his 40’s purchased a brand-new Audi and had been out on the interstate just for a good night ride. The roof was down, a wind was blowing through what was left of his hair and man decided to open her way up. Since the needle hopped as much as eighty miles per hour, he suddenly noticed blinking crimson and blue lighting behind him. “There’s no way they can catch this auto!,” he thought to himself and opened it up further. The needle come to ninety, hundred…. Then the fact of the problem hit him. “What the hell ‘m I doing?” he thought and pulled over. The cop came up to him, took his licence without any word and reviewed it as well as the car. “It’s been a very long day, this is the end of my shift and it is Friday the 13th. I do not feel like additional paperwork, thus if you are able to provide me an reason for your driving a car which I never have heard before, you possibly can go.” The guy thinks about for a second and says, “Last week my wife leaped away with a cop. I was frightened you was trying to give her back.” “Have a wonderful weekend,” says the policeman.
I want to start blogging too, what do you think, which blog platform is good for beginner?
I just needed to say that I found your blog via Goolge and I am glad I did. Keep up the good work and I will make sure to bookmark you for when I have more free time away from the books. Thanks again!
Wherever is it, i like to read much more about this article, thank you.
Really great informative blog post here and I just wanted to comment & thank you for posting this. I’ve bookmarked youi blog and I’ll be back to read more in the future my friend! Also nice colors on the layout, it’s really easy on the eyes.
This site is so great that i will honor it with my comment
Excellent read, I must say. You’ve researched the topic very well
Wow this takes me back. Adding to my bookmarks thanks.
Hello there Webmaster, check out my new Shocking Autoblog System, which will let you quit your Job within just 7 Days. Now you can change your life using the exact same system that’s made $27,352 in the first 30 Days! Download Now The Most Powerful Automated Money Machine ever: http://tinyurl.com/auto-blog-system
Yikes this really takes me back, i’ve been thinking about this subject for a while.
Have you ever thought about adding a little bit more than just your thoughts? I mean, what you say is important and everything. But its got no punch, no pop! Maybe if you added a pic or two, a video? You could have such a more powerful blog if you let people SEE what youre talking about instead of just reading it.
This is a topic close to my heart cheers, found you through Bing.
Hi dude, can i post articles to your blog ? Let me know if you are interested
Adding to my bookmarks cheers, please consider a follow up post.
Yikes this definitely takes me back, where is your contact details though?
Hypotheken? Heel veel hypotheek informatie: verschillende hypotheekvormen, hypotheekrentes, nationale hypotheek garantie, hoe een hypotheek te vergelijken.
Well see in which time we liveAs a Newbie, I am always searching online for articles that can help me. Thank you
Thank you for this blog post, it was great to read.
Lenen zonder BKR toetsing gaat vandaag heel gemakkelijk. Binnen een paar uur geld lenen zonder BKR toetsing doet u hier, lees snel verder
We just couldnt leave your website before letting you know that we really enjoyed the quality information you offer to your visitors… Will be back soon to check up on new stuff you post!
Hi,Carl from Best Timeshare Rentals.Thanks for commenting on my website.I just thought it’s better for me to visit back to say thanks here:)
The artical is so excellent!
It’s always hard to keep good body shape. Dont believe those ab circle pro free trial scams if you dont want to suffer a economical loss!
there is no such game as Champions Online can you please suggest some similar games?. I own a xbox 360
Make an impression on! what an idea !?! What a concept ! Lovely .. Incredible …
Excellent article but for whatever reason your weblogs layout theme has a couple problems in the NetSurf v3.06 web browser. I simply wanted to let you know…
Excellent blog post but for some reason your weblogs layout has a couple problems in the Avant v4.06 web browser. I just wanted to tell you…
Playing mafia wars is way better than commenting on shitty blogs and you can use mafia wars cheats.
Hey admin, extremely informative blog post! Pleasee continue this awesome work..
psychologie der farben | lernen web design | schneller internet
Thanks for taking the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely useful for me.
This is an extremely great site you have going here. The matter is very informative and straight to the point. Excited to read more about your blog next time.
I will add this blog to my favorites, it is great.
I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks – you cleared up some things for me!
Hey Boss – its a nice blog, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend me about it?
I love the blog. Great post. It is very true, people must learn how to learn before they can learn. lol i know it sounds funny but its very true. . .
Very nice and helpful information has been given in this article. I like the way you explain the things. Keep posting. Thanks. . .
So Great! I need some infos in this post for my rapport de stage. Can i have your contact please? I need your permission to quote it
. Anyway, That’s great job. Keep going.
Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.
Hey – nice blog, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?
Have found your web page. My pal mentioned it to me before, yet never got around to checking it out until now. I must express, I’m floored. I really enjoyed reading through your posts and will absolutely be back to get more.