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

Terraform Compliance, starting

Automating mybinder.org dependency upgrades in 10 steps

Cheap and local Kubernetes playground with K3s & Helm

My Journey To Development

How to deserialize AVRO messages in Python Faust?

Symfony, a Lifelong Friend

Monthly Dev Update — January 2021

RVP Claiming Tutorial

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

Streaming Data Architecture — Key Components and Patterns

Software Architecture in GCP— Use Pub/Sub with Cloud Storage to process data automatically when…

Discover, Catalog and Share your Streams on Amazon MSK as Data Products

Streaming Data Exchange with Kafka and a Data Mesh in Motion