Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HumanFactory ¶
type HumanFactory struct { }
func (*HumanFactory) CreateWhite ¶
func (factory *HumanFactory) CreateWhite() Human
func (*HumanFactory) CreateYellow ¶
func (factory *HumanFactory) CreateYellow() Human
type HumanFactoryInf ¶
缺点:当需要增加创建black时则代码改动很大 优点:可以控制创建产品的关系,我们可以将CreatWhite和CreatYellow内置,然后对外提供Create限制CreatWhite和CreatYellow关系
Click to show internal directories.
Click to hide internal directories.