Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Factory Pattern

One of the goals of object-oriented design is to delegate responsibility among different objects. This kind of partitioning is good since it encourages Encapsulation and Delegation.

Tutorial Details:

One of the goals of object-oriented design is to delegate responsibility among different objects. This kind of partitioning is good since it encourages Encapsulation and Delegation.

A class may need it's subclasses to specify the objects to be created or delegate responsibility to one of several helper subclasses so that knowledge can be localized to specific helper subclasses. Even Sometimes, an Application (or framework) at runtime, is not able to judge properly the class of an object that it must create. The Application (or framework) may know that it has to instantiate classes, but it may only know about abstract classes (or interfaces), which it cannot instantiate. Thus the Application class may only know when it has to instantiate a new Object of a class, not what kind of subclass to create.


 

Rate Tutorial:
http://www.roseindia.net/designpattern/factoryDesignPatterns.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Factory Pattern

View Tutorial:
Factory Pattern

Related Tutorials:

Clever Facade makes JDBC look easy
Clever Facade makes JDBC look easy
 
Smarter Java development - JavaWorld August 1999
Smarter Java development - JavaWorld August 1999
 
Java Tip 78: Recycle broken objects in resource pools - JavaWorld
Java Tip 78: Recycle broken objects in resource pools - JavaWorld
 
Take control of the servlet environment, Part 1 - JavaWorld November 2000
Take control of the servlet environment, Part 1 - JavaWorld November 2000
 
Make an EJB from any Java class with Java Reflection - JavaWorld December 2000
Make an EJB from any Java class with Java Reflection - JavaWorld December 2000
 
When is a Singleton not a Singleton? - JavaWorld January 2001
When is a Singleton not a Singleton? - JavaWorld January 2001
 
J2EE project dangers! - JavaWorld March 2001
J2EE project dangers! - JavaWorld March 2001
 
Build secure network applications with SSL and the JSSE API - JavaWorld May 2001
Build secure network applications with SSL and the JSSE API - JavaWorld May 2001
 
Superior app management with JMX - JavaWorld June
Integrate JMX, a reusable configuration framework, with your JSPs
 
Explore the Dynamic Proxy API
Explore the Dynamic Proxy API
 
Write once, persist anywhere
Write once, persist anywhere
 
J2EE or J2SE? JNDI works with both
J2EE or J2SE? JNDI works with both
 
Design patterns make for better J2EE apps
Design patterns make for better J2EE apps
 
Jump the hurdles of Struts development
Jump the hurdles of Struts development
 
JavaServer Faces, redux
JavaServer Faces, redux
 
Create client-side user interfaces in HTML, Part 2
Create client-side user interfaces in HTML, Part 2
 
To my mind, of few interest
To my mind, of few interest
 
Worth reading
Worth reading
 
FindBugs - A Bug Pattern Detector for Java
FindBugs - A Bug Pattern Detector for Java This is the web page for FindBugs, a program which looks for bugs in Java code. It is free software, distributed under the terms of the Lesser GNU Public License.
 
Second-generation aspect-oriented programming
Second-generation aspect-oriented programming
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.