Программная инжененрия для JavaScript, TypeScrip, Node.js
👉 Group: https://t.me/How_Programming_Works
👉 Node.js channel: https://t.me/metarhia
👉 Node.js group: https://t.me/nodeua
Post #1641
4.32K
🙊 The Law of Demeter (LoD): Don’t talk to strangers
If you see something like this:
👉
👉
👉
You have technical debt! It's time to plan refactoring.
Each entity (unit/instance) should have only limited knowledge about others (only "closely" related to the current one).
Each entity should only talk to its friends (immediate friends): don’t talk to strangers!
Вut don't do it in a panic and do not mix refactoring with other issues (like new features implementation).
Just note that and plan resource allocation.
If you see something like this:
👉
connection.parent.service.storage.db.saveRecord👉
this.action.scenario.bot.telegram.sendMessage👉
service.find('logger').kind('error').stream.writeYou have technical debt! It's time to plan refactoring.
Each entity (unit/instance) should have only limited knowledge about others (only "closely" related to the current one).
Each entity should only talk to its friends (immediate friends): don’t talk to strangers!
Вut don't do it in a panic and do not mix refactoring with other issues (like new features implementation).
Just note that and plan resource allocation.
- 👍 17
- 💯 2









