From OO to Gogo
Introduction
Object Oriented
vs
Package Oriented
Object Oriented
Data are encapsulated inside a
class
.
These data can be accessed and modified only by methods.
Package Oriented
Data are encapsulated inside a
package
.
Within a package, data can be freely accessed and modified.
Data Encapsulation
Object Oriented
Package Oriented
Circular Dependencies
Background
Problem & Design
MU
TU
SU
Apply to
Stable Matching Problem
Observer Pattern
Strategy Pattern
The Design
Let's Code!
https://github.com/kohpai/oo2go
Conclusions
Go, combined with OO design, somehow enforces the use of interface, which aligns with OO principles
"Program to interfaces, not implementations"
You
MIGHT
end up with one big package serving merely one purpose - to provide all the interfaces
Questions?
Made with Slides.com