Spis treści
Advice:
- Learn SOLID principles and try to use it.
- Think about class as physical object: what can it do, who can change its data, what it should not do.
- Think, how objects can communicate with each other.
- Base the relationships on abstraction.
- Make hermetic objects.
- Classes and methods should not do too much.
- A class should change only itself data.
- Find common responsibilities and put in special classes (like validating mail address).
- Write clean, readable and pretty code.
- Chose composition over inheritance.
How to better program in object-oriented paradigm:
Read a book: The Object-Oriented Thought Process — Matt Weiffeld and make exercises.
How to exercise:
Find an application, which is written in structural paradigm and change it into object-oriented.
All posts from mini project: Learn SOLID and OOP principles:
- SOLID
- SOLID exercises
- S like Single responsibility principle
- SOLID exercises — Kata
- O as Open-closed principle
- L jak Liskov Substitution Principle
- Interface segregation principle
- KISS — Keep it simple, stupid
- DRY — Don’t repeat yourself
- Dependency inversion principle
- SLAP — Single Level of Abstraction Principle
- Composition Over Inheritance
- Encapsulate what changes
- Lod — Law of Demeter
- ES as Exercises of Single responsibility principle
- EO as Exercises of Open/closed principle
- EL as Exercises of Liskov Substitution Principle
- EI as Eexrcises of Interface segregation principle
- ES as Exercises of Dependency Inversion Principle
- Object-oriented programming
- OOP — Object-Oriented Programming — Advice
- OOP — Object Oriented Programming
Sources
Main image
Materials
- https://www.marekczuma.pl/2016/07/12/programowanie-obiektowe-czyli-jak-programowac-aby-skutecznie-tworzyc-realny-swiat/
- https://mansfeld.pl/programowanie/zalety-i-wady-oop/
- https://blog.artmetic.pl/recenzja-ksiazki-myslenie-obiektowe-w-programowaniu/
- https://it-consulting.pl/autoinstalator/wordpress/2014/05/29/myslenie-obiektowe-w-programowaniu/
- https://bulldogjob.pl/news/846-czym-sa-zapachy-kodu-w-php-czysty-kod-z-podejsciem-oop
- https://www.marekczuma.pl/2016/07/12/programowanie-obiektowe-czyli-jak-programowac-aby-skutecznie-tworzyc-realny-swiat/
Sorry, there was a YouTube error.