Link to home
Start Free TrialLog in
Avatar of Eindoofus
Eindoofus

asked on

Could someone please point me to sample Java code of a Factory using multiple Impls?

I want to see an example of how the factory decision making process works with returning delegates. Could anybody send me some link or point me to some source code?
Avatar of for_yan
for_yan
Flag of United States of America image


Wikipedia has explanation and code examples also:

http://en.wikipedia.org/wiki/Factory_method_pattern

This is example of Abstract Factory
http://javacamp.org/designPattern/abstractfactory.html

I think this is a good example of Factory method  with popular and easy understandable interface Shape:
http://javacamp.org/designPattern/factory.html

There is actually a distinction between Abstract Factory and Factory method - again there are two articles in wikipedia explaining it:

http://en.wikipedia.org/wiki/Abstract_factory_pattern

and this (which  I mentioned above):

http://en.wikipedia.org/wiki/Factory_method_pattern





ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial