期刊名称:Journal of Emerging Trends in Computing and Information Sciences
电子版ISSN:2079-8407
出版年度:2012
卷号:3
期号:10
页码:1411-1418
出版社:ARPN Publishers
摘要:It is well known that the Abstract Factory design pattern defines a new Abstract Product Factory for each family of products. Adding a new family of products affects any existing class that depends on it, and requires complex changes in the existing Abstract Factory code, as well as changes in the application or client code. Many papers discuss this issue and the issues related to increasing the number of classes. Often these papers recommend the Prototype pattern, or another solution is to add a parameter to operations that creates objects. This paper offers another approach to this issue—it employs a specially designed database, and in this way it reduces the number of Abstract Product factories and Concrete Product classes to one per Abstract Factory family. Also, adding a new product is comprehensible for the existing code, and in cases when it is necessary to add a new product, all changes are implemented without any actions related to alterations or updates of existing code.
关键词:Design-Patterns; Abstract Factory; Patterns Best Practice; Creational Patterns; Patterns by Example