I'm focused on developing and expanding my knowledge and skills. Enjoying new challenges. I'm assuming that there are no stupid questions, there are only silly answers.
Very nice post with a descriptive example of usage. Real life examples always are adding additional value to an example. I'm a big fan of design patterns too so I enjoyed this post.
Personally I'd change inheritance to composition for ShouldDelete method, but once again great article.
I'm focused on developing and expanding my knowledge and skills. Enjoying new challenges. I'm assuming that there are no stupid questions, there are only silly answers.
Very nice post with a descriptive example of usage. Real life examples always are adding additional value to an example. I'm a big fan of design patterns too so I enjoyed this post.
Personally I'd change inheritance to composition for ShouldDelete method, but once again great article.
Could you make an example?
Sure.
Instead of inheriting from a base class and method overriding like here:
You add the class variable of a given class and calls it's method if needed.
More about the comparison between Inheritance and Composition you can find here. Take a closer look at the table at the end of article.