replay challenge
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of JBoss AS 5 Development this week in the JBoss forum
or Spring Dynamic Modules in Action in the Spring forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
Author

Design Patterns

Abhi Kumar
Greenhorn

Joined: Sep 11, 2008
Messages: 23

Hello All,
Thanks for reading my post.

I'm in need of some good explanation/implementation for the Adapter and Visitor design patterns in Java..

Any good tutorial would be of great help ...

Thanks
James Clarks
Bartender

Joined: Apr 16, 2008
Messages: 1222

Is there anything that you do not understand about the patterns? If yes, please explain.

BigDecimalBear/>
Kengkaj Sathianpantarit
Ranch Hand

Joined: Jul 05, 2005
Messages: 1936

I don't know any good online reference, you can read from Design Patterns [GoF].

SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Abhi Kumar
Greenhorn

Joined: Sep 11, 2008
Messages: 23


*** HOMEWORK ASSIGNMENT NOTICE ***

Hi All,
Thanks for the responses.
I'm new to Java and Design patterns.I would like to implement the Adapter design pattern for the below BusinessCase.

The case goes like this


A power switch is required that can turn on or off any number of appliances. An appliance is for example a Blender, a Toaster, or an Oven.

Other programmers have already written those appliances and you can't change their source code (to, for example, require them all to implement a particular interface).
Fortunately, each such appliance already has two methods to turn its particular appliance on and off.
Unfortunately, all such methods were written by different people and have different names (examples: Blender.swizzle(), Toaster.startToasting(), Oven.heatUp()).

write three third party appliances and put them in a separate package. It should be visible from the output of each appliance whether it is turned on or off (in its third party vocabulary).
-Make a representation of a multi-power point. You can plug in as many appliances as you wish and turn them on and off all at once, by turning the multi-power point on() and off().


I would appreciate for any help.
Any class diagrams would be of great help.
Thanks


*** HOMEWORK ASSIGNMENT NOTICE ***

This message was edited 1 time. Last update was at by James Clark

James Clarks
Bartender

Joined: Apr 16, 2008
Messages: 1222

*** HOMEWORK ASSIGNMENT NOTICE ***

Abhi Kumar, your post contains material which resembles a homework assignment. If it is, you should try to complete the
assignment on your own. If you run into specific problems, then posting a question is reasonable. However, expecting
complete answers is not.

Good luck!

*** HOMEWORK ASSIGNMENT NOTICE ***

BigDecimalBear/>
Abhi Kumar
Greenhorn

Joined: Sep 11, 2008
Messages: 23

Thanks for the response.I'm done with this..
Thanks for all your support which made me to finish it successfully ...
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
replay challenge