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!”Category: Software Development
Python & Django Introduction for Developers
It is time for me to dig deeper into Python and setup an own project! This article will contain a collection of links with useful articles experienced developers, so that they can easily get into Python.
Continue reading “Python & Django Introduction for Developers”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
PHP: Installation of newest package version vs. update package
There is the little bit misleading composer command: composer update. It also allow to only update 1 to n packages with composer update package1 package2 (package names as arguments. Howevery, there is a constraint to be considered! composer update is updating the packages within the defined requirements – thus it is not updating the package.json!
If you want to install the newest package version, you must add the package as a new requirement with composer require. This way the newest (or older version if dependencies are blocking the newest) package will be used. composer install overwrites the package.json.
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)”