From dfd2e61c505d69f06abb0ae76114c28b1bf3cb31 Mon Sep 17 00:00:00 2001 From: VisualPlugin Date: Sun, 30 Apr 2023 04:44:18 +0000 Subject: [PATCH 1/2] Update README.md --- 12-letterbox/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/12-letterbox/README.md b/12-letterbox/README.md index 31eafcf..c56e228 100644 --- a/12-letterbox/README.md +++ b/12-letterbox/README.md @@ -18,3 +18,23 @@ Possible names: - Messaging style - Objects - 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 + +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 From f923e1cc7ea505a772f8c95fd09d0c41124162a0 Mon Sep 17 00:00:00 2001 From: VisualPlugin Date: Sun, 30 Apr 2023 06:01:25 +0000 Subject: [PATCH 2/2] Update README.md --- 12-letterbox/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/12-letterbox/README.md b/12-letterbox/README.md index c56e228..09fd9bd 100644 --- a/12-letterbox/README.md +++ b/12-letterbox/README.md @@ -31,6 +31,8 @@ Constraints: - 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