Skip to content

Commit ab6b62e

Browse files
committed
simplify
1 parent 09f31a4 commit ab6b62e

4 files changed

Lines changed: 0 additions & 20 deletions

File tree

  • exercises

exercises/03.inheritance/01.problem.extends/README.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,5 @@ it with specific shapes like `Circle` and `Rectangle`.
1111
4. Create a `Rectangle` class that extends `Shape`
1212
5. Add `width` and `height` fields to `Rectangle`
1313

14-
💰 Use `extends` to inherit fields and methods from a base class.
15-
16-
💰 Don't forget to call `super()` in the constructor if the parent has a
17-
constructor.
1814

1915
📜 [TypeScript Handbook - Inheritance](https://www.typescriptlang.org/docs/handbook/2/classes.html#inheritance)

exercises/03.inheritance/02.problem.method-overriding/README.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ method to provide its own implementation.
1010
3. Override `getArea()` in `Rectangle` to return width × height
1111
4. Optionally use `super` to call the parent method
1212

13-
💰 Override a method by redefining it in the subclass.
14-
15-
💰 You can call `super.method()` to use the parent's implementation if needed.
1613

1714
📜 [TypeScript Handbook - Overriding Methods](https://www.typescriptlang.org/docs/handbook/2/classes.html#overriding-methods)

exercises/04.polymorphism/01.problem.substitutability/README.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ We'll use polymorphism to handle all media types uniformly.
1111
4. Create a `MediaPlayer` class with a method that accepts `MediaFile`
1212
5. Demonstrate that both `AudioFile` and `VideoFile` can be used interchangeably
1313

14-
💰 Accept the base class type so any subclass can be used.
1514

1615
📜 [TypeScript Handbook - Classes](https://www.typescriptlang.org/docs/handbook/2/classes.html)

exercises/05.composition-vs-inheritance/01.problem.when-to-use/README.mdx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ inheritance or composition for different scenarios.
1111
4. Create a `ConsoleLogger` class that uses inheritance (is-a Logger)
1212
5. Demonstrate when each approach is appropriate
1313

14-
💰 Inheritance (is-a):
15-
16-
- `FileLogger` IS-A `Logger`
17-
- `ConsoleLogger` IS-A `Logger`
18-
- They are specializations of Logger
19-
20-
💰 Composition (has-a):
21-
22-
- `EmailService` HAS-A `Logger`
23-
- EmailService uses logging but isn't a type of logger
24-
- Can swap different loggers at runtime
25-
2614
💰 Think about the relationship: Is it "is-a" or "has-a"?
2715

2816
📜 [Composition over Inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance)

0 commit comments

Comments
 (0)