Add second year
This commit is contained in:
@ -0,0 +1,35 @@
|
||||
- #[[CT2106 - Object-Oriented Programming]]
|
||||
- **Previous Topic:** [[Variables & Types]]
|
||||
- **Next Topic:** [[Introduction to Inheritance]]
|
||||
- **Relevant Slides:**   
|
||||
-
|
||||
- # Modelling the Problem
|
||||
- A major part of OOP is modelling the problem.
|
||||
- The goal is to identify the **principle objects** in the problem domain, which we model as classes, the **responsibility** of each of these objects, and the **collaborations** between objects.
|
||||
- The objective of OOP Modelling is to produce a simplified **class diagram**.
|
||||
- **Classes** represent real-world entities.
|
||||
- **Associations** represent collaborations between the entities.
|
||||
- **Attributes** represent the data held about these entities.
|
||||
- **Generalisation** can be used to simplify the structure of the model.
|
||||
- What are **nouns** in OOP? #card
|
||||
card-last-interval:: 11.2
|
||||
card-repeats:: 3
|
||||
card-ease-factor:: 2.8
|
||||
card-next-schedule:: 2022-10-20T02:53:27.410Z
|
||||
card-last-reviewed:: 2022-10-08T22:53:27.411Z
|
||||
card-last-score:: 5
|
||||
- **Nouns** are candidate objects in OOP.
|
||||
-
|
||||
- # OOP Principles
|
||||
card-last-interval:: 4
|
||||
card-repeats:: 2
|
||||
card-ease-factor:: 2.7
|
||||
card-next-schedule:: 2022-10-11T10:41:16.772Z
|
||||
card-last-reviewed:: 2022-10-07T10:41:16.772Z
|
||||
card-last-score:: 5
|
||||
- Consider the following principles when assigning responsibilities:
|
||||
- An **Object** is responsible for its own data.
|
||||
- An Object is responsibility for communicating its state.
|
||||
- **Single Responsibility Principle:** Each **Class** should have a ^^single responsibility.^^
|
||||
- All its services should be aligned with that responsibility.
|
||||
-
|
Reference in New Issue
Block a user