Skip to content

Commit f8e801d

Browse files
author
Dominik Liebler
committed
README AbstractFactory
1 parent f1e8c57 commit f8e801d

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

AbstractFactory/AbstractFactory.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@
33
namespace DesignPatterns\AbstractFactory;
44

55
/**
6-
* Abstract Factory pattern
7-
*
8-
* Purpose:
9-
* to create series of related or dependant objects without specifying their concrete classes,
10-
* usually the created classes all implement the same interface. The client of the abstract
11-
* factory does not care about how these objects are created, he just knows they go together.
12-
*
13-
* Sometimes also known as "Kit" in a GUI libraries.
6+
* class AbstractFactory
147
*
8+
* Sometimes also known as "Kit" in a GUI libraries.
9+
*
1510
* This design pattern implements the Dependency Inversion Principle since
1611
* it is the concrete subclass which creates concrete components.
17-
*
12+
*
1813
* In this case, the abstract factory is a contract for creating some components
19-
* for the web. There are two components : Text and Picture. There is two ways
14+
* for the web. There are two components : Text and Picture. There is two ways
2015
* of rendering : HTML or JSON.
21-
*
16+
*
2217
* Therefore 4 concretes classes, but the client just need to know this contract
2318
* to build a correct http response (for a html page or for an ajax request)
2419
*/

AbstractFactory/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Abstract Factory
2+
3+
## Purpose
4+
5+
To create series of related or dependant objects without specifying their concrete classes.
6+
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.

0 commit comments

Comments
 (0)