Skip to content

andreasenz/Java-Design-Patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Navigation

Creational Patterns

Navigation

Abstract Factory

Intent

Provide an interface for creating families of related or dependent objects without specifying concrete classes.

Also Known As

Kit

Applicability

Use the Abstract Factory pattern when

  • a system should be independet of how its products are created, composed, and represented
  • a system sould be cofingured with one of multiple families of products
  • a family of related product objects is designed to be used togheter, and you need to enforce this constranint
  • you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations

Structure

Partecipants

  • AbstractFactory: declares an interface for operations that create abstract products objects
  • ConcreteFactory implements the operations to create concrete product objects
  • AbstractProduct: declares an interface for a type of product object
  • ConcreteProduct: defines a product object to be created by the corresponding factory. Implements the AbstractProduct interface
  • Client: uses only interfaces delcared by AbstractFactory and AbstractProduct classes

Disclaimer

The knowledge reported in this guide is the result of the study and reworking of the Gang of Four book "Design Patterns: Elements of Reusable Object-Oriented Software".

About

Some example of Design Pattern written in Java lang. Some hint are attached in the description.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages