Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
This is part of a series
Object Oriented Design Tip # 1
Identifiers are (almost) never present on the real world. So why should you build your models with them ?
Objects can send messages to other objects only if they know them.
Knowledge can be accidental (temporary) or essential (strong).
Object1 knows essentially object2 and that relation must be named. And naming is very important when dealing with objects.
Role naming is extremely important.
Never qualify a relation exposing referenced object implementation.
object1 should not name the variable object2id.
Making such thing would imply a relational database implementation and thus mixing essential model specification with an accidental relational implementation.
Objects should know other objects, not ids !
Name and reference objects. Not IDs was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.