#author("2023-07-30T07:17:52+09:00","default:ryuichi","ryuichi")
#author("2023-07-30T08:42:35+09:00","default:ryuichi","ryuichi")
* データ指向プログラミング [#b1410c55]
** UML [#y104dfae]
#ref(./smartdraw-uml.png,50%)
*** 汎化/継承 (Generalization/Inheritance) [#yac323c3]
''汎化:''
Vehicle
/ \
/ \
Car Motorcycle
*** コンポジション/集約 (Composition/Aggregation) [#j33af56d]
''コンポジション:''
Car <>- Engine
Car <>- Wheel
Car <>- Seat
Car <>- SteeringWheel
- CarがなければEngineはない
- EngineがなくてもCarはある(Carは正常に動作しないけれども)
''集約:''
University <>-- Student
- UniversityがなくてもStudentは存在しうる
- StudentがなくてもUniversityは存在しうる
''破線:''
- 使用依存関係
#ref(./smartdraw-uml-symbols.png)
** 古典的なOOPの問題点 [#e7b9c9da]
|Aspect|Impact on complexity|h
|Code and data are mixed.|Classes tend to be involved in many relations.|
|Objects are mutable.|Extra thinking is needed when reading code.|
|Objects are mutable.|Explicit synchronization is required on multi-threaded environments.|
|Data is locked in objects.|Data serialization is not trivial.|
|Code is locked in classes.|Class hierarchies are complex.|
- 備考
-- Code: 振る舞い。ロジックコードのこと