File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Design Patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "Design Patterns" Watch "Design Patterns" New topic
Author

Design Patterns

Abhi Kumar
Greenhorn

Joined: Sep 11, 2008
Posts: 24
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
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2050
Is there anything that you do not understand about the patterns? If yes, please explain.
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 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
Posts: 24

*** 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

Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2050
*** 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 ***
Abhi Kumar
Greenhorn

Joined: Sep 11, 2008
Posts: 24
Thanks for the response.I'm done with this..
Thanks for all your support which made me to finish it successfully ...
 
 
subject: Design Patterns
 
developer file tools