I always say in my trainings and coaching, don’t write code, write the story down. I have found following article on medium: write code poetry.
Category: Clean Code
Flaws in OOP practice: use flat composition and interfaces instead of hierarchical inheritance!
OOP is associated with Inheritance, Encapsulation and Polymorphism. These should enable maintainable and re-usable code. Let’s see how this ends up in practice and what are the solutions, so that you REALLY get maintainable and re-usable code. Based on an interesting and entertaining article on medium by Charles Scalfani. This article is a summary. If you need some explanations and examples you should read the original article.
Continue reading “Flaws in OOP practice: use flat composition and interfaces instead of hierarchical inheritance!”Article recommendations: decorator pattern vs inheritance|AOP
Starting from Python decorators I wanted to dig deeper what the software engineering community says about decorators and differences to other main concepts. I come up with following recommendations:
- When to use AOP or decorator in your architecture: https://crosscuttingconcerns.com/AOP-vs-decorator
- Difference between AOP and decorator:
https://damnhandy.com/2005/07/05/aop-is-not-simply-a-decorator/ - Decorator and subclassing and good mentioning of common Liskov violation: https://stackoverflow.com/a/15231311
- Decorator and class hierarchy:
https://dzone.com/articles/is-inheritance-dead - Starting point: decorators in Python (nice and simple introduction into topic)
https://python-3-patterns-idioms-test.readthedocs.io/en/latest/PythonDecorators.html - A second introduction, but Angular:
https://ultimatecourses.com/blog/angular-decorators
ValueObjects and its usage in classes (in comparison to states and dependencies)
I saw following recently in a pull request I was supposed to review. A ValueObject was used as an property – for a validator class.
Continue reading “ValueObjects and its usage in classes (in comparison to states and dependencies)”