Merge pull request #55 from Windows81/patch-1

Clarify Exercise 12.2
This commit is contained in:
crista
2023-04-30 14:22:58 -07:00
committed by GitHub

View File

@@ -18,3 +18,25 @@ Possible names:
- Messaging style - Messaging style
- Objects - Objects
- Actors - Actors
## Style #12.2
Constraints:
- For each 'thing' class, let's bring the `info` methods from the Things style (#11)
- In the Things style, we used inheritance via a Python call to `super` to call a shared function from a base class
- We should apply this concept of code-reuse, but make sure to do so without using inheritance
- In typed languages, using delegates (or `Callable` in Python) is a recommended solution
- Just like in style 11, we will not be calling `info` in the main routine
Note:
A [delegate](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/using-delegates?source=recommendations) is a type that safely encapsulates a method, similar to a function pointer in C and C++. Unlike C function pointers, delegates are object-oriented, type safe, and secure
Possible names:
- Delegation