Better construction with factories

12Citations
Citations of this article
6Readers
Mendeley users who have this article in their library.

Abstract

The polymorphic nature of object oriented programs means that client code expecting an instance of class C may use instead an instance of a class C′ inheriting from C. But, in order to use such a different instance, one must create it, and in order to do so in current languages, must be familiar with the name of creating class. To break this coupling, we propose the novel notion of factories, which are class services (alongside methods and constructors) that manage the instancecreation step of object construction. In making the case for factories we propose a five-dimensional framework for understanding and analyzing the class notion in various programming languages. We show that factories can naturally replace the "creational" design patterns, and describe the design and implementation of a JAVA language extension supporting both supplier-side and client-side factories. Possible implementations in other languages are discussed as well. © JOT, 2002.

Cite

CITATION STYLE

APA

Cohen, T., & Gil, J. (2007). Better construction with factories. Journal of Object Technology, 6(6), 109–129. https://doi.org/10.5381/jot.2007.6.6.a3

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free