Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 402 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 402 Bytes

代码结构

- src
  - OrganizationComponent.go # 组合部件抽象类或接口
  - CompanyComposite.go # 具体部件实现之一,树枝构件
  - DepartmentComposite.go # 具体部件实现之一,树枝构件
  - EmployeeLeaf.go # 具体部件的叶子节点,叶子节点不能再含有子节点

测试验证

$ cd ./composite-pattern/go
$ go run test/test.go