The goal is to demonstrate the chain design patter. I implemented a simple stupid code. It basically does nothing complicated, we have a Company object, and we wanna add staff.
I know this is a very dummy code, and you can write it in many different ways but i would like to show an example for chain design pattern.
I have 5 different implementations based on my personal experience how I've been writing code since primary school.
It is a simple code for implementing a Company object. One simple file, that's all (spaghetti code)
Refactoring the code, creating methods, using tuples as return value.
Refactoring the code, realising there are objects, and inheritance exists.
A real programmer realises that there are design patterns that could be useful during his/her career. Final refactor step.
Overkilled code base, extending the programmer code with the Observer design pattern. It's a little bit too much but seems to be a great fun. The purpose of the observer pattern is that, we should recalculate the CEO and the partners' salary when a new employee is added.