Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShapeFactory ¶
type ShapeFactory struct { }
------- factory 也可以定义一个Shape Factory结构体,通过结构体方法来生产shape对象 上面的NewShape少写一些代码,这种方法可以在factory上再进行一些自定义
func (ShapeFactory) GetShape ¶
func (sf ShapeFactory) GetShape(shape string) Shape
Click to show internal directories.
Click to hide internal directories.