8000 gotraining/06-composition at master · jmktam/gotraining · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
 
 

06-composition

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

Composition

Composition goes beyond the mechanics of type embedding. It's a design pattern we can leverage in Go to build larger programs from smaller parts. These smaller parts come from the declaration and implementation of types that have a single focus. Programs that are architected with composition in mind have a better chance to grow and adapt to changes.

Notes

  • Declare types and behavior with composition in mind.
  • Composition is like building software with lego blocks.
  • This is much more than the mechanics of type embedding.

Links

http://golang.org/doc/effective_go.html#embedding

Code Review

Composition I (Game) | (Example)

Composition II (Go Playground)

Exercises

Exercise 1

0