Have you heard of Domain-Driven Design (DDD), a major software design approach?
DDD was introduced in Eric Evans’ classic book “Domain-Driven Design: Tackling Complexity in the Heart of Software”. It explained a methodology to model a complex business. In this book, there is a lot of content, so I'll summarize the basics.
𝐓𝐡𝐞 𝐜𝐨𝐦𝐩𝐨𝐬𝐢𝐭𝐢𝐨𝐧 𝐨𝐟 ��𝐨𝐦𝐚𝐢𝐧 𝐨𝐛𝐣𝐞𝐜𝐭𝐬:
🔹Entity: a domain object that has ID and life cycle.
🔹Value Object: a domain object without ID. It is used to describe the property of Entity.
🔹Aggregate: a collection of Entities that are bounded together by Aggregate Root (which is also an entity). It is the unit of storage.
𝐓𝐡𝐞 𝐥𝐢𝐟𝐞 𝐜𝐲𝐜𝐥𝐞 𝐨𝐟 𝐝𝐨𝐦𝐚𝐢𝐧 𝐨𝐛𝐣𝐞𝐜𝐭𝐬:
🔹Repository: storing and loading the Aggregate.
🔹Factory: handling the creation of the Aggregate.
𝐁𝐞𝐡𝐚𝐯𝐢𝐨𝐫 𝐨𝐟 𝐝𝐨𝐦𝐚𝐢𝐧 𝐨𝐛𝐣𝐞𝐜𝐭𝐬:
🔹Domain Service: orchestrate multiple Aggregate.
🔹Domain Event: a description of what has happened to the Aggregate. The publication is made public so others can consume and reconstruct it.
Congratulations on getting this far. Now you know the basics of DDD. If you want to learn more, I highly recommend the book. It might help to simplify the complexity of software modeling.
Over to you: do you know how to check the equality of two Value Objects? How about two Entities?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/FIzCeaWsZV
não lembro onde ou com quem aprendi, mas um princípio que levo pra minha vida de dev eh:
“dev(a) não lida com achismo, pois achismo gera retrabalho e prejuízo”
então sempre que não tenho certeza de algo eu vou atrás de buscá-la seja onde for.
Healthy team habit: Create Architectural Decision Records (ADR)
ADRs document big decisions.
Benefits:
✅ Everyone understands how the decision was made
✅ Centralizes team feedback on a big decision
✅ Useful to reference later if people leave or the decision is reconsidered.
Tip: Learn "how" to learn.
While things (like tech) change, what helps you adapt quickly is a mental model for how to learn, "make it stick" and apply: https://t.co/SLWRWl58hO
Já começaram a aparecer no mercado os projetos de reversão de microsserviços. Eu previ isso uns anos atrás.
Foram gastos milhões em uma modinha que não é pra todo mundo. Agora levaremos ano arrumando a decisão errada de executivos não técnicos que usaram isso pra se promover.
Aproveitar o assunto, quero deixar meus 2 centavos empíricos sobre algo que raramente escrevo aqui:
*Testes em Software*
Minha reflexão é uma mistura de sentido empírico com base na minha experiência e algum estudo do que no sentido concreto ou literal.
Testes, a thread 🧵