Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Factory Method


  
  Factory object - Wikipedia, the free encyclopedia
A factory object typically has a method for every kind of object it is capable of creating.
Factory objects are used in situations where getting hold of an object of a particular kind is a more complex process than simply creating a new object.
The factory object might decide the created object's class (if applicable) dynamically, return it from an object pool, do complex configuration on the object, or other things.
en.wikipedia.org /wiki/Factory_object   (128 words)

  
 Factory method -- Facts, Info, and Encyclopedia article   (Site not responding. Last check: 2007-10-25)
A Factory method is a (additional info and facts about static method) static method of a ((biology) a taxonomic group containing one or more orders) class that (An abstract or general idea inferred or derived from specific instances) constructs another instance of an object.
It is used when the class knows more about the object than the client.
Often in classes that have factory methods, are those who have private constructor(s) and other initialisation occurs before the instance is produced.
www.absoluteastronomy.com /encyclopedia/f/fa/factory_method.htm   (101 words)

  
 Factory Patterns in C#
The Factory Method provides a simple decision making class that can return the object of one of several subclasses of an abstract base class depending on the information that are provided.
A factory pattern is one that returns an instance of one of several possible classes depending on the data provided to it.
Instead we are using the getObject() method of the Factory class to return an appropriate instance depending on the value passed to the getObject() method.
www.c-sharpcorner.com /Language/FactoryPatternsinCSRVS.asp   (421 words)

  
 Factory method design pattern   (Site not responding. Last check: 2007-10-25)
The second variation of the factory method pattern is the Manufacturer class is a concrete class and provides a default implementation for the factory method (Gamma et al., 1995).
One drawback of the factory method is that it may have to subclass the creator classes, which causes there to be more classes overall.
Even though the factory method has some drawbacks such as the one mentioned above, we feel that it is a pattern that should be used by all because the advantages of using this pattern outweigh the disadvantages.
pages.cpsc.ucalgary.ca /~ansella/seng443   (2003 words)

  
 design:the_factory_method [phpPatterns]
The factory method is one of the fundamental patterns which is both simple and powerful, helping us to delegate responsibilities to other classes and keep code easy to maintain.
The factory method is a creational method; a method in a class (or even just a PHP function) which returns instances of new classes.
A handy trick in some cases, when using the factory method, is to create the product class and pass it an instance of the creator class at the same time, allowing the product to have access to the creator.
www.phppatterns.com /docs/design/the_factory_method   (678 words)

  
 ONDotnet.com: The Factory Design Pattern
Factory methods can encapsulate the logic required to return a singleton instance of the class requested, or they can return an instance of the requested class from a pool of instances.
Factory methods can return any subtype of the type requested, and can require that clients refer to the returned object by its interface, rather than the implementation class.
Factory methods come into play when different types of objects need to be instantiated, based on the type of incoming request.
www.ondotnet.com /pub/a/dotnet/2003/08/11/factorypattern.html   (1909 words)

  
 Factories Making Factories
Factories are used to create families of related objects without having to specify the exact class.
This factory method is not static, so we need to create a shape first to use it.
Since we realize the factories as anonymous objects inside the shapes, the shape and the factory are grouped tightly together to represent their close relationship.
www.cs.rice.edu /~mgricken/research/dp4mbs/lecture   (1595 words)

  
 Factory Method   (Site not responding. Last check: 2007-10-25)
People often use Factory Method as the standard way to create objects; but it isn't necessary if: the class that's instantiated never changes, or instantiation takes place in an operation that subclasses can easily override (such as an initialization operation).
Factory Method is similar to Abstract Factory but without the emphasis on families.
Factory Methods are routinely specified by an architectural framework, and then implemented by the user of the framework.
home.earthlink.net /~huston2/dp/factoryMethod.html   (327 words)

  
 Subject-oriented programming and the factory method pattern
The fundamental problem for which the Factory Method pattern is used has two elements: the client's notion class of the node to be created and the context which affects the actual choice of a class.
The Factory Method pattern creates two redundant elements: the factory which must be created and accessed by the node, and the access path by which a node finds the factory.
While applications are also composed at points of method calls, having two applications provide substantive implementations for a factory method is problematic, because they appear to each create the object at different times, and it receives two identities that may not be reconcilable.
www.research.ibm.com /sop/sopcfmep.htm   (1033 words)

  
 The Factory Method Design Pattern by Gopalan Suresh Raj
The Factory method lets a class defer instantiation to subclasses" Thus, as defined by Gamma et al, "The Factory Method lets a class defer instantiation to subclasses".
A potential problem with factory methods is that they might force you to subclass just to create the appropriate Objects.
Creating objects inside a class with a factory method is always more flexible than creating an object directly.
gsraj.tripod.com /design/creational/factory/factory.html   (1693 words)

  
 [No title]   (Site not responding. Last check: 2007-10-25)
Factory methods allow you to create an application framework without needing to bind application-specific classes into your code.
Using the Factory Method allows you to create views for documents without the application code having any knowledge about their relationship.
The Factory Method design pattern allows you to write applications that are more flexible in what types they can incorporate by deferring creation of classes within the system to subclasses that can be extended as the object model is extended.
www.devhood.com /tutorials/tutorial_details.aspx?tutorial_id=645   (1486 words)

  
 Design Pattern Questions - Travis Sparks
The factory provides a centralized place to put decision code for selecting between sub classed objects.
In the normal design of an abstract factory this is the case, however, it would be possible to pass a parameter to a factory method and return one of many sub classed objects based on that parameter.
Using the Composite for the Template Method may be confusing to the implementer if the algorithm is not "composed" of many primitive and composite algorithm components.
www.cs.unc.edu /~sparkst/comp204/patterns   (1708 words)

  
 Sum00 Final Exam Review: Design Patterns   (Site not responding. Last check: 2007-10-25)
Factory Method and Abstract Factory Method are both used for the exact same purpose: the need for a creational abstraction that lets someone focus on the interface for a class instead of the actual implementation and thus let subclasses decide exactly what to instantiate.
Thus this factory object has the responsibility to provide the services for the creation of the entire family and creates product objects having a specific implementation, often by defining a factory method.
The focus of the Factory Method pattern is to provide virtual creation through inheritance and the system should be open for extension by multiple subclasses of the same family.
coweb.cc.gatech.edu /cs2340/779   (705 words)

  
 Krzysztof Cwalina : Design Guidelines Update: Factories vs. Constructors
A Factory is an operation or collection of operations that abstract the object creation process for API users, allowing for specialized semantics and finer granularity of control over an object’s instantiation by the API provider.
Factory methods are sometimes logically aggregated into a dedicated Factory type, but just as often appear on the individual classes which are to be created.
The System.Convert class exposes many such static Factory methods that take a value type in one representation and convert it to an instance of a different value type, retaining the same logical state in the process.
blogs.msdn.com /kcwalina/archive/2004/10/11/241027.aspx   (1660 words)

  
 Abstract Factory   (Site not responding. Last check: 2007-10-25)
The benefit of using Abstract Factory is that it abstracts the object creation process and thus stops hard coding of object creation in client code.
We have also used a factory maker class that accepts an argument from client and decides the concrete factory to be instantiated.
The concrete factory can be implemented as a singleton as we can use only one factory to create all the related objects of one product family.
www.mycgiserver.com /~mkanojia/patterns/AbsFactory.html   (603 words)

  
 [No title]
Factory mass production of pocketknives more than two centuries ago.
Methods of one of the last Case factory authorized repairmen.
The standard introduction and reference on all types of knives: folding and fixed blade, old and new, factory and hand-made.
pweb.netcom.com /~brlevine/kbib99.txt   (1775 words)

  
 New Document
It is often used in Abstract Factory implementation, where there are parallel hierarchies of classes to be crated.
The Factory Method pattern is useful for constructing individual objects for a specific purpose without the construction requester knowing the specific classes being instantiated.
The Factory Method pattern is often used with the Template Method pattern.
www.mycgiserver.com /~mkanojia/patterns/Factory.html   (457 words)

  
 Unit testing with mock objects
Assure that the factory method is accessible to the target object and its subclasses.
Because we overrode the factory method to write this test, it turns out that we no longer have any test coverage of the original creation code (which is now inside the base class's factory method).
The source of the factory method and abstract factory design patterns is Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley, 1997) by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides -- also known as the Gang of Four.
www-128.ibm.com /developerworks/java/library/j-mocktest.html?dwzone=java   (2364 words)

  
 jGuru: Abstract Factory VS Factory Method
In the factory method design pattern All creaters needs to be subclassed while in Abstract Factory method only one class is need to be subclassed.
Factory method has only one creator while abstract factory method has multiple creators.
Whereas the factory method is a way to get one individual member of a family.
www.jguru.com /forums/view.jsp?EID=1226993   (118 words)

  
 Factory methods
Factory method is just a fancy name for a method that instantiates objects.
However, if you use a factory method to obtain your instance, you need to make only one change in one class in order to meet the new requirements.
Further, factory methods prove useful when you're not sure what concrete implementation of a class to instantiate.
www.javaworld.com /javaworld/javaqa/2001-05/02-qa-0511-factory.html   (624 words)

  
 MethodInvokingFactoryBean (Spring Framework)
This factory bean is still useful though when you need to call a method which doesn't return any value (for example, a static class method to force some sort of initialization to happen).
Note that as it is expected to be used mostly for accessing factory methods, this factory by default operates in a singleton fashion.
While the user of the factory bean is presumably calling the method to perform some sort of initialization, and doesn't care about any return value, all factory beans must return a value, so this special singleton instance is used for this case.
www.springframework.org /docs/api/org/springframework/beans/factory/config/MethodInvokingFactoryBean.html   (791 words)

  
 COMP 204: Software Design and Implementation
Factory methods eliminate the need to bind application specific classes into the code.
As a result, the code is not tightly bound to a particular application, rather, the factory methods defer instantation for specific applications to the subclasses.
Even though the method called may not be a part of A's interface, the Decorator pattern allows the addition of other operations for specific functionality.
www.duke.edu /~jad1/comp204   (2414 words)

  
 Bug ID: 4619333 stddoclet: Separate out static factory methods and add @factory tag
I avoided needing a @factory tag by using a heuristic James came up with: assume that a method is a static factory if it is static and returns the type of the class it's defined in.
Constructor Summary Static Factory Method Summary Inner Class Summary Field Summary Method Summary However, Tom suggested the static factory summary be just ahead of the constructor summary, and that those methods be removed from the non-static factory method summary.
Each method writer is called to build up a list of methods for its summary, but each one then checks whether each method is owned by it or not; if not, it is removed from the list.
bugs.sun.com /bugdatabase/view_bug.do?bug_id=4619333   (1012 words)

  
 Pattern Summaries: Factory Method
This is any concrete class instantiated by the objects participating in the Factory Method pattern.
The method takes whatever arguments are needed to deduce the class to instantiate.
Suppose you are developing an extension to the Socket class to encrypt the stream of bytes written to a socket and decrypt the bytes read from the socket.
www.developer.com /java/other/article.php/618421   (1572 words)

  
 The Log Package   (Site not responding. Last check: 2007-10-25)
Use of the factory method or the singleton method is preferred.
This parameter is only available when the factory method or the singleton method are used.
method is only implemented by the console handler, the file handler and the mail handler.
www.indelible.org /pear/Log/guide.php   (2332 words)

  
 Factory Method   (Site not responding. Last check: 2007-10-25)
Implement a factory instance method whose sole purpose is to instantiate and answer the new object.
The selector for a factory method should be of the form #newXXX, where XXX is a description (not the class) of the resultant object.
Better still, the factory class method should not hard-code the class name at all but, instead, should request the class name from a Constant Access Method.
www.object-arts.com /Lib/EducationCentre4/htm/factorymethod.htm   (360 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.