This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### The product to contruct #### | |
class Product(object): | |
def __init__(self, extra): | |
self.extra = extra | |
def do_somthing(self): | |
print "Doing Something{0}!".format(self.extra) | |
#### The Builder for a type of product #### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## The Factory's base class ######### | |
class AbstractFactory(object): | |
def create_product(self, **args): | |
raise NotImplementedError("Requires derived factory class for implementation.") | |
######### The class of the object that needs creating ########### | |
class Product(object): | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The First Class | |
* | |
/* |
NewerOlder