mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 01:32:22 +01:00
README AbstractFactory
This commit is contained in:
parent
f1e8c5796f
commit
f8e801d445
@ -3,22 +3,17 @@
|
||||
namespace DesignPatterns\AbstractFactory;
|
||||
|
||||
/**
|
||||
* Abstract Factory pattern
|
||||
* class AbstractFactory
|
||||
*
|
||||
* Sometimes also known as "Kit" in a GUI libraries.
|
||||
*
|
||||
* Purpose:
|
||||
* to create series of related or dependant objects without specifying their concrete classes,
|
||||
* usually the created classes all implement the same interface. The client of the abstract
|
||||
* factory does not care about how these objects are created, he just knows they go together.
|
||||
*
|
||||
* Sometimes also known as "Kit" in a GUI libraries.
|
||||
*
|
||||
* This design pattern implements the Dependency Inversion Principle since
|
||||
* it is the concrete subclass which creates concrete components.
|
||||
*
|
||||
*
|
||||
* In this case, the abstract factory is a contract for creating some components
|
||||
* for the web. There are two components : Text and Picture. There is two ways
|
||||
* for the web. There are two components : Text and Picture. There is two ways
|
||||
* of rendering : HTML or JSON.
|
||||
*
|
||||
*
|
||||
* Therefore 4 concretes classes, but the client just need to know this contract
|
||||
* to build a correct http response (for a html page or for an ajax request)
|
||||
*/
|
||||
|
6
AbstractFactory/README.md
Normal file
6
AbstractFactory/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Abstract Factory
|
||||
|
||||
## Purpose
|
||||
|
||||
To create series of related or dependant objects without specifying their concrete classes.
|
||||
Usually the created classes all implement the same interface. The client of the abstract factory does not care about how these objects are created, he just knows how they go together.
|
Loading…
x
Reference in New Issue
Block a user