Add second year
This commit is contained in:
@ -0,0 +1,52 @@
|
||||
- #[[CT2106 - Object-Oriented Programming]]
|
||||
- **Previous Topic:** [[First Java Code]]
|
||||
- **Next Topic:** null
|
||||
- **Relevant Slides:** 
|
||||
-
|
||||
- # Composition & Inheritance
|
||||
- ## Composition
|
||||
- What is **Composition**? #card
|
||||
card-last-interval:: 4
|
||||
card-repeats:: 1
|
||||
card-ease-factor:: 2.6
|
||||
card-next-schedule:: 2022-09-21T20:50:47.300Z
|
||||
card-last-reviewed:: 2022-09-17T20:50:47.301Z
|
||||
card-last-score:: 5
|
||||
- **Composition** is a type of "has-a" relationship. One object is **composed** of another and relies upon its services for its own functionality.
|
||||
- It is one of the fundamental relationships between classes in OOP.
|
||||
- For example:
|
||||
- The class `RacingBike` **has-a** `Wheel` - **Composition**.
|
||||
- How do you represent **Composition** in OOP class diagrams? #card
|
||||
card-last-interval:: 9.55
|
||||
card-repeats:: 2
|
||||
card-ease-factor:: 2.6
|
||||
card-next-schedule:: 2022-09-29T07:30:34.783Z
|
||||
card-last-reviewed:: 2022-09-19T18:30:34.784Z
|
||||
card-last-score:: 5
|
||||
- In OOP class diagrams, a **diamond shape** indicates **composition** or a "has-a" relationship.
|
||||
- 
|
||||
- This class diagram tells us that a `Vehicle` object is composed of a single `Engine` object.
|
||||
- How do you realise **Composition** in Java? #card
|
||||
card-last-interval:: 4
|
||||
card-repeats:: 1
|
||||
card-ease-factor:: 2.36
|
||||
card-next-schedule:: 2022-09-21T19:47:12.777Z
|
||||
card-last-reviewed:: 2022-09-17T19:47:12.777Z
|
||||
card-last-score:: 3
|
||||
- To realise a "has-a" relationship in Java, you must ^^create a link between the **participant classes** using a **reference type variable**.^^
|
||||
- The reference declaration is in the **owner** class.
|
||||
-
|
||||
- # Inheritance
|
||||
- What is **Inheritance**? #card
|
||||
card-last-interval:: -1
|
||||
card-repeats:: 1
|
||||
card-ease-factor:: 2.5
|
||||
card-next-schedule:: 2022-09-19T23:00:00.000Z
|
||||
card-last-reviewed:: 2022-09-19T18:31:39.621Z
|
||||
card-last-score:: 1
|
||||
- **Inheritance** is a type of "is-a" relationship.
|
||||
- It is one of the fundamental relationships between classes in OOP.
|
||||
- For example:
|
||||
- A `RacingBike` **is-a** type of `Bicycle` - **Inheritance**.
|
||||
-
|
||||
-
|
@ -0,0 +1,52 @@
|
||||
- #[[CT2106 - Object-Oriented Programming]]
|
||||
- **Previous Topic:** [[First Java Code]]
|
||||
- **Next Topic:** null
|
||||
- **Relevant Slides:** 
|
||||
-
|
||||
- # Composition & Inheritance
|
||||
- ## Composition
|
||||
- What is **Composition**? #card
|
||||
card-last-interval:: 4
|
||||
card-repeats:: 2
|
||||
card-ease-factor:: 2.7
|
||||
card-next-schedule:: 2022-10-04T09:28:05.146Z
|
||||
card-last-reviewed:: 2022-09-30T09:28:05.146Z
|
||||
card-last-score:: 5
|
||||
- **Composition** is a type of "has-a" relationship. One object is **composed** of another and relies upon its services for its own functionality.
|
||||
- It is one of the fundamental relationships between classes in OOP.
|
||||
- For example:
|
||||
- The class `RacingBike` **has-a** `Wheel` - **Composition**.
|
||||
- How do you represent **Composition** in OOP class diagrams? #card
|
||||
card-last-interval:: 10.8
|
||||
card-repeats:: 3
|
||||
card-ease-factor:: 2.7
|
||||
card-next-schedule:: 2022-10-15T07:08:01.227Z
|
||||
card-last-reviewed:: 2022-10-04T12:08:01.227Z
|
||||
card-last-score:: 5
|
||||
- In OOP class diagrams, a **diamond shape** indicates **composition** or a "has-a" relationship.
|
||||
- 
|
||||
- This class diagram tells us that a `Vehicle` object is composed of a single `Engine` object.
|
||||
- How do you realise **Composition** in Java? #card
|
||||
card-last-interval:: -1
|
||||
card-repeats:: 1
|
||||
card-ease-factor:: 2.36
|
||||
card-next-schedule:: 2022-09-30T23:00:00.000Z
|
||||
card-last-reviewed:: 2022-09-30T09:28:00.640Z
|
||||
card-last-score:: 1
|
||||
- To realise a "has-a" relationship in Java, you must ^^create a link between the **participant classes** using a **reference type variable**.^^
|
||||
- The reference declaration is in the **owner** class.
|
||||
-
|
||||
- # Inheritance
|
||||
- What is **Inheritance**? #card
|
||||
card-last-interval:: 2.22
|
||||
card-repeats:: 2
|
||||
card-ease-factor:: 2.36
|
||||
card-next-schedule:: 2022-10-02T14:27:50.641Z
|
||||
card-last-reviewed:: 2022-09-30T09:27:50.642Z
|
||||
card-last-score:: 3
|
||||
- **Inheritance** is a type of "is-a" relationship.
|
||||
- It is one of the fundamental relationships between classes in OOP.
|
||||
- For example:
|
||||
- A `RacingBike` **is-a** type of `Bicycle` - **Inheritance**.
|
||||
-
|
||||
-
|
@ -0,0 +1,52 @@
|
||||
- #[[CT2106 - Object-Oriented Programming]]
|
||||
- **Previous Topic:** [[First Java Code]]
|
||||
- **Next Topic:** [[Variables & Types]]
|
||||
- **Relevant Slides:** 
|
||||
-
|
||||
- # Composition & Inheritance
|
||||
- ## Composition
|
||||
- What is **Composition**? #card
|
||||
card-last-interval:: 10.24
|
||||
card-repeats:: 3
|
||||
card-ease-factor:: 2.56
|
||||
card-next-schedule:: 2022-10-17T15:22:03.790Z
|
||||
card-last-reviewed:: 2022-10-07T10:22:03.790Z
|
||||
card-last-score:: 3
|
||||
- **Composition** is a type of "has-a" relationship. One object is **composed** of another and relies upon its services for its own functionality.
|
||||
- It is one of the fundamental relationships between classes in OOP.
|
||||
- For example:
|
||||
- The class `RacingBike` **has-a** `Wheel` - **Composition**.
|
||||
- How do you represent **Composition** in OOP class diagrams? #card
|
||||
card-last-interval:: 10.8
|
||||
card-repeats:: 3
|
||||
card-ease-factor:: 2.7
|
||||
card-next-schedule:: 2022-10-15T07:08:01.227Z
|
||||
card-last-reviewed:: 2022-10-04T12:08:01.227Z
|
||||
card-last-score:: 5
|
||||
- In OOP class diagrams, a **diamond shape** indicates **composition** or a "has-a" relationship.
|
||||
- 
|
||||
- This class diagram tells us that a `Vehicle` object is composed of a single `Engine` object.
|
||||
- How do you realise **Composition** in Java? #card
|
||||
card-last-interval:: 3.58
|
||||
card-repeats:: 2
|
||||
card-ease-factor:: 2.46
|
||||
card-next-schedule:: 2022-10-10T23:31:31.282Z
|
||||
card-last-reviewed:: 2022-10-07T10:31:31.282Z
|
||||
card-last-score:: 5
|
||||
- To realise a "has-a" relationship in Java, you must ^^create a link between the **participant classes** using a **reference type variable**.^^
|
||||
- The reference declaration is in the **owner** class.
|
||||
-
|
||||
- # Inheritance
|
||||
- What is **Inheritance**? #card
|
||||
card-last-interval:: 8.88
|
||||
card-repeats:: 3
|
||||
card-ease-factor:: 2.22
|
||||
card-next-schedule:: 2022-10-15T14:18:15.221Z
|
||||
card-last-reviewed:: 2022-10-06T17:18:15.222Z
|
||||
card-last-score:: 3
|
||||
- **Inheritance** is a type of "is-a" relationship.
|
||||
- It is one of the fundamental relationships between classes in OOP.
|
||||
- For example:
|
||||
- A `RacingBike` **is-a** type of `Bicycle` - **Inheritance**.
|
||||
-
|
||||
-
|
Reference in New Issue
Block a user