Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

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?
0
Eindoofus
Asked:
Eindoofus
  • 4
1 Solution
 
for_yanCommented:

Wikipedia has explanation and code examples also:

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

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





0
 
for_yanCommented:

this has a great list of using all design patterns including factories in standard Java API:

http://stackoverflow.com/questions/1673841/examples-of-gof-design-patterns
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now