- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 107字
- 2021-06-25 20:52:29
Aggregation
An aggregation is a special type of association. If inheritance is considered to be the is-a relationship, aggregation can be considered to be the HAS-A relationship.
Aggregation is used to describe a relation between two or more classes, when one class contains the other from a logical point of view, but instances of the contained class can live independently of the first class, outside of its context, or can be shared among other classes. For example, a Department HAS-A Teacher; additionally, every Teacher must belong to Department, but if a Department ceases to exist, a Teacher can still be active as shown in the following diagram:

推薦閱讀
- Vue.js 3.x快速入門
- C++程序設計(第3版)
- 計算機圖形學編程(使用OpenGL和C++)(第2版)
- Game Programming Using Qt Beginner's Guide
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- Visual FoxPro 程序設計
- 動手玩轉Scratch3.0編程:人工智能科創教育指南
- BeagleBone Media Center
- 精通API架構:設計、運維與演進
- Instant RubyMotion App Development
- Windows Phone 7.5:Building Location-aware Applications
- Learning R for Geospatial Analysis
- 測試架構師修煉之道:從測試工程師到測試架構師
- OpenCV Android Programming By Example
- Learning Python Data Visualization