Skip to content

Commit b74623c

Browse files
committed
edit readme
edit readme
1 parent 905a4a0 commit b74623c

11 files changed

Lines changed: 60 additions & 60 deletions

File tree

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Abstract Factory Pattern 抽象工厂模式
2-
##Definition
2+
## Definition
33

44
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
55
<br>提供一个接口,用于创建相关或者依赖对象的家族,而不需要指定具体的实现类。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/abstract.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###AbstractFactory (ContinentFactory)
14+
### AbstractFactory (ContinentFactory)
1515
* declares an interface for operations that create abstract products
1616

17-
###ConcreteFactory (AfricaFactory, AmericaFactory)
17+
### ConcreteFactory (AfricaFactory, AmericaFactory)
1818
* implements the operations to create concrete product objects
1919

20-
###AbstractProduct (Herbivore, Carnivore)
20+
### AbstractProduct (Herbivore, Carnivore)
2121
* declares an interface for a type of product object
2222

23-
###Product (Wildebeest, Lion, Bison, Wolf)
23+
### Product (Wildebeest, Lion, Bison, Wolf)
2424
* defines a product object to be created by the corresponding concrete factory
2525
* implements the AbstractProduct interface
2626

27-
###Client (AnimalWorld)
27+
### Client (AnimalWorld)
2828
* uses interfaces declared by AbstractFactory and AbstractProduct classes
2929

3030

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
# Builder Pattern 建造者模式
2-
##Definition
2+
## Definition
33

44
Separate the construction of a complex object from its representation so that the same construction process can create different representations.
55
<br>将一个复杂对象的构造与它的表示分离,使同样的构建过程可以创建不同的表示,这样的设计模式被称为建造者模式。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/builder.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Builder (VehicleBuilder)
14+
### Builder (VehicleBuilder)
1515
* specifies an abstract interface for creating parts of a Product object
1616

17-
###ConcreteBuilder (MotorCycleBuilder, CarBuilder, ScooterBuilder)
17+
### ConcreteBuilder (MotorCycleBuilder, CarBuilder, ScooterBuilder)
1818
* constructs and assembles parts of the product by implementing the Builder interface
1919
* defines and keeps track of the representation it creates
2020
* provides an interface for retrieving the product
2121

22-
###Director (Shop)
22+
### Director (Shop)
2323
* constructs an object using the Builder interface
2424

25-
###Product (Vehicle)
25+
### Product (Vehicle)
2626
* represents the complex object under construction. ConcreteBuilder builds the product's internal representation and defines the process by which it's assembled
2727
* includes classes that define the constituent parts, including interfaces for assembling the parts into the final result
2828

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Factory Method Pattern 工厂方法模式
2-
##Definition
2+
## Definition
33

44
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
55
<br>定义一个用于创建对象的接口,让子类决定实例化哪一个类。工厂方法使一个类的实例化延迟到其子类。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/factory.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Product (Page)
14+
### Product (Page)
1515
* defines the interface of objects the factory method creates
1616
* ConcreteProduct (SkillsPage, EducationPage, ExperiencePage)
1717
* implements the Product interface
1818

19-
###Creator (Document)
19+
### Creator (Document)
2020
* declares the factory method, which returns an object of type Product. Creator may also define a default implementation of the factory method that returns a default ConcreteProduct object.
2121
* may call the factory method to create a Product object.
2222

23-
###ConcreteCreator (Report, Resume)
23+
### ConcreteCreator (Report, Resume)
2424
* overrides the factory method to return an instance of a ConcreteProduct.
2525

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Prototype Pattern 原型模式
2-
##Definition
2+
## Definition
33

44
Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype.
55
<br>用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/prototype.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Prototype (ColorPrototype)
14+
### Prototype (ColorPrototype)
1515
* declares an interface for cloning itself
1616

17-
###ConcretePrototype (Color)
17+
### ConcretePrototype (Color)
1818
* implements an operation for cloning itself
1919

20-
###Client (ColorManager)
20+
### Client (ColorManager)
2121
* creates a new object by asking a prototype to clone itself
2222

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Singleton Pattern 单例模式
2-
##Definition
2+
## Definition
33

44
Ensure a class has only one instance and provide a global point of access to it.
55
<br>确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/singleton.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Singleton (LoadBalancer)
14+
### Singleton (LoadBalancer)
1515
* defines an Instance operation that lets clients access its unique instance. Instance is a class operation.
1616
* responsible for creating and maintaining its own unique instance.
1717

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# Bridge Pattern 桥接模式
2-
##Definition
2+
## Definition
33

44
Decouple an abstraction from its implementation so that the two can vary independently.
55
<br>将抽象和实现解耦,使得两者可以独立地变化。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/bridge.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Abstraction (BusinessObject)
14+
### Abstraction (BusinessObject)
1515
* defines the abstraction's interface.
1616
* maintains a reference to an object of type Implementor.
1717

18-
###RefinedAbstraction (CustomersBusinessObject)
18+
### RefinedAbstraction (CustomersBusinessObject)
1919
* extends the interface defined by Abstraction.
2020

21-
###Implementor (DataObject)
21+
### Implementor (DataObject)
2222
* defines the interface for implementation classes. This interface doesn't have to correspond exactly to Abstraction's interface; in fact the two interfaces can be quite different. Typically the Implementation interface provides only primitive operations, and Abstraction defines higher-level operations based on these primitives.
2323

24-
###ConcreteImplementor (CustomersDataObject)
24+
### ConcreteImplementor (CustomersDataObject)
2525
* implements the Implementor interface and defines its concrete implementation.
2626

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# Composite Pattern 组合模式
2-
##Definition
2+
## Definition
33

44
Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
55
<br>将对象组合成树形结构以表示“部分-整体”的层次结构,使得用户对单个对象和组合对象的使用具有一致性。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/composite.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Component (DrawingElement)
14+
### Component (DrawingElement)
1515
* declares the interface for objects in the composition.
1616
* implements default behavior for the interface common to all classes, as appropriate.
1717
* declares an interface for accessing and managing its child components.
1818
* (optional) defines an interface for accessing a component's parent in the recursive structure, and implements it if that's appropriate.
1919

20-
###Leaf (PrimitiveElement)
20+
### Leaf (PrimitiveElement)
2121
* represents leaf objects in the composition. A leaf has no children.
2222
* defines behavior for primitive objects in the composition.
2323

24-
###Composite (CompositeElement)
24+
### Composite (CompositeElement)
2525
* defines behavior for components having children.
2626
* stores child components.
2727
* implements child-related operations in the Component interface.
2828

29-
###Client (CompositeApp)
29+
### Client (CompositeApp)
3030
* manipulates objects in the composition through the Component interface.
3131

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Decorator Pattern 装饰模式
2-
##Definition
2+
## Definition
33

44
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
55
<br>动态地给一个对象添加一些额外的职责。就增加功能来说,装饰模式相比生成子类更为灵活。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/decorator.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Component (LibraryItem)
14+
### Component (LibraryItem)
1515
* defines the interface for objects that can have responsibilities added to them dynamically.
1616

17-
###ConcreteComponent (Book, Video)
17+
### ConcreteComponent (Book, Video)
1818
* defines an object to which additional responsibilities can be attached.
1919

20-
###Decorator (Decorator)
20+
### Decorator (Decorator)
2121
* maintains a reference to a Component object and defines an interface that conforms to Component's interface.
2222

23-
###ConcreteDecorator (Borrowable)
23+
### ConcreteDecorator (Borrowable)
2424
* adds responsibilities to the component.
2525

Assets/Structural Patterns/Facade Pattern/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Facade Pattern 外观模式
2-
##Definition
2+
## Definition
33

44
Provide a unified interface to a set of interfaces in a subsystem. Façade defines a higher-level interface that makes the subsystem easier to use.
55
<br>要求一个子系统的外部与其内部的通信必须通过一个统一的对象进行。外观模式提供一个高层次的接口,使得子系统更易于使用。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/facade.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Facade (MortgageApplication)
14+
### Facade (MortgageApplication)
1515
* knows which subsystem classes are responsible for a request.
1616
* delegates client requests to appropriate subsystem objects.
1717

18-
###Subsystem classes (Bank, Credit, Loan)
18+
### Subsystem classes (Bank, Credit, Loan)
1919
* implement subsystem functionality.
2020
* handle work assigned by the Facade object.
2121
* have no knowledge of the facade and keep no reference to it.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Flyweight Pattern 享元模式
2-
##Definition
2+
## Definition
33

44
Use sharing to support large numbers of fine-grained objects efficiently.
55
<br>使用共享对象可有效地支持大量的细粒度的对象。
66

77
![](https://github.com/QianMo/Unity-Design-Pattern/blob/master/UML_Picture/flyweight.gif)
88

99

10-
##Participants
10+
## Participants
1111

1212
The classes and objects participating in this pattern are:
1313

14-
###Flyweight (Character)
14+
### Flyweight (Character)
1515
* declares an interface through which flyweights can receive and act on extrinsic state.
1616

17-
###ConcreteFlyweight (CharacterA, CharacterB, ..., CharacterZ)
17+
### ConcreteFlyweight (CharacterA, CharacterB, ..., CharacterZ)
1818
* implements the Flyweight interface and adds storage for intrinsic state, if any. A ConcreteFlyweight object must be sharable. Any state it stores must be intrinsic, that is, it must be independent of the ConcreteFlyweight object's context.
1919

20-
###UnsharedConcreteFlyweight ( not used )
20+
### UnsharedConcreteFlyweight ( not used )
2121
* not all Flyweight subclasses need to be shared. The Flyweight interface enables sharing, but it doesn't enforce it. It is common for UnsharedConcreteFlyweight objects to have ConcreteFlyweight objects as children at some level in the flyweight object structure (as the Row and Column classes have).
2222

23-
###FlyweightFactory (CharacterFactory)
23+
### FlyweightFactory (CharacterFactory)
2424
* creates and manages flyweight objects
2525
* ensures that flyweight are shared properly. When a client requests a flyweight, the FlyweightFactory objects assets an existing instance or creates one, if none exists.
2626

27-
###Client (FlyweightApp)
27+
### Client (FlyweightApp)
2828
* maintains a reference to flyweight(s).
2929
* computes or stores the extrinsic state of flyweight(s).
3030

0 commit comments

Comments
 (0)