This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Can anybody provide a comparison between the above patterns ? Strategy is a kind of Adapter and an strategy object is also a Facade object, since it provides a level of indirection to the underlying interfaces / classes. On what basis, one can distinguish by looking at a class, whether it is a Adapter or a Strategy class (other than the naming style of the class)? Because, I feel there is a lot of overlapping and the distinction between these classes are kind of blur..( atleast to me ) Please share your thoughts.. Thanks.
Strategy is a kind of Adapter and an strategy object is also a Facade object, since it provides a level of indirection to the underlying interfaces / classes. Adapter is a structural pattern. Adapter uses indirection to modify the interface of a class. In this, the adapter 'uses' the 'oldClass'. And the client class 'uses' the adapter. Strategy is a behavioral pattern. In this you will see a super-sub type relationship. The sub-types implement the strategy laid out by the super class. In this, the interface of one class is not modified by the other. It is a generalization relationship. The client 'uses' the supertype. The question whether the structure (interface) of a class is modified by the pattern? will tell you if the pattern is an adapter patten or not. Generalization relation is by which you can identify the strategy pattern (also in case of template pattern. Both Template and Strategy are same except in their intent of use). That is what my understanding is. Any corrections are welcome. I do not know about Facade pattern. I will be glad if you can explain it. Thanks.
MM Koppula<br />SCJP2<br />Object Oriented Analysis and Design with UML (IBM)
Thanks Kyle for the link. Merlin, thanks for your inputs.
I do not know about Facade pattern. I will be glad if you can explain it.
As per my understanding, a Facade object provides a single unified interface and is responsible for collaborating with other(subsystem) objects. Basically, it provides a single point of contact for the subsystem (wrapping the subsystem). The advantage of this pattern, is that a client needs to interact only with one unified interface for all the subsystem services. Hope it helps. Also, I am planning to take the IBM certification exam (486), soon. I have prepared for about 3 weeks now and have mainly relied on Larman's book for majority of the concepts. Also, have been referring UML Distilled and other Design patterns/UML related books. Have also taken the ICE test, scoring 94% and also the brainbench test. Can anyone please share their preparation tips for the 486 exam? Thanks.
Merlin M Koppula
Joined: Jan 18, 2002
Suresh, I took the brain bench test too. Eventhough I passed the test, I had a poor score. I think the brainbench test is more notation oriented and I found it more difficult than the ICE test. Do you know if the actual test is more in line with ICE test or the brainbench test? I have been preparing OOAD for last couple of months. In fact I can say I wasted a lot of weeks not knowing the right resources, before I started looking into JavaRanch. Eventhough I learnt some stuff, from exam point of view, I wasted a lot of time by reading OOAD by Booch (However, there are some good applications at the end of the book). I read thru UML distilled a couple of times. But I completed Larman only half. (you see, I am not a fast reader). I am planing to read it thru 2nd Eloboration before I take the test. Do you know of anyone who passed the test without completing Larman? It would help if others share their preparation experience too. Thanks.