Skip to content

Commit 74c4935

Browse files
committed
Adds description to Builder
1 parent a7045f8 commit 74c4935

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

creational/builder.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,28 @@
22
# -*- coding : utf-8 -*-
33

44
"""
5+
*What is this pattern about?
6+
It decouples the creation of a complex object and its representation,
7+
so that the same process can be reused to build objects from the same
8+
family.
9+
This is useful when you must separate the specification of an object
10+
from its actual representation (generally for abstraction).
11+
12+
*What does this example do?
13+
This particular example uses a Director to abtract the
14+
construction of a building. The user specifies a Builder (House or
15+
Flat) and the director specifies the methods in the order necessary
16+
creating a different building dependding on the sepcified
17+
specification (through the Builder class).
18+
519
@author: Diogenes Augusto Fernandes Herminio <diofeher@gmail.com>
620
https://gist.github.com/420905#file_builder_python.py
21+
22+
*Where is the pattern used practically?
23+
24+
*References:
25+
https://sourcemaking.com/design_patterns/builder
26+
727
"""
828

929

0 commit comments

Comments
 (0)