Handling Complex Business Scenarios with Domain Modeling — Part 1

Why Is Data Modeling Necessary?

Benefits of Domain Modeling

Object-oriented

  • Encapsulation: We can encapsulate Account related operations in the Account Entity, improving cohesion and reusability.
  • Polymorphism: OverdraftPolicy with policy mode (a typical application of polymorphism) improves code extensibility.

Explicit Business Semantics

  • Common language: “One team, one language” using the model as the backbone of the language. Make sure that the team uses the same language in all internal communication, code, drawing, writing, and especially speaking. For example, account number, transfer, overdraft strategy; these are all very important domain concepts. If these names are consistent with our daily discussions and the description in PRD, it will significantly improve the readability of the code and reduce the mental gymnastics required to understand it.
  • Explicit: This refers to extracting hidden business logic from a pile of if-else statements, use language to name them, write code, expand it, and then turn it into an explicit concept. For example, the crucial business concept of the “Overdraft Strategy.” According to the way in which we write the event script, its meaning is all over the code logic but is never explicitly dated. Anyone looking at the code would be flabbergasted; however, the domain model uses a strategic method to abstract it, not only increasing the usability of the code but making it much more scalable.

How Do We Implement Domain Modeling?

Modeling method

Model Unification and Model Evolution

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Program 24/1/22_0

Setting up CI/CD for a PREN app with Jenkins, Docker and GitHub Webhooks on Container Registry

Working STEPN Activation Code Generator

Build your own Objects Analytics Dashboard with ELK Stack

Enhance your Chatbot Experience with Rich Attachments

How to scrap the Housing Market

Switch Statements in Unity

Customizing Protobuf JSON Serialization in Golang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

The Architect, The Starter, and The Closer

Addressing Technical Debt to Build Technical Wealth

Trunk-Based Development for Higher Operational Performance

Micro services and Conway’s law