concept model in category system administration

appears as: model, models, The model, A model, model
Functional and Reactive Domain Modeling

This is an excerpt from Manning's book Functional and Reactive Domain Modeling.

Figure 1.4. Relationships between the domain elements of a model. This example is from the personal banking domain. Note that Account, Bank, and so forth are entities. An entity can contain other entities or value objects. A service is at a higher level of granularity and implements behaviors that involve multiple domain elements.

When was the last time you withdrew cash from an ATM? Or deposited cash into your bank account? Or used internet banking to check whether your monthly pay has been credited to your checking account? Or asked for a portfolio statement from your bank? All these italicized terms relate to the business of personal banking. We call this the domain of personal banking. The word domain here means the area of interest in the business. When you’re developing a system to automate banking activities, you’re modeling the business of personal banking. The abstractions that you design, the behaviors that you implement, and the UI interactions that you build all reflect the business of personal banking—together they constitute the model of the domain.

Before you look into the specific features that make Scala a suitable language for implementing functional and reactive domain models, let’s briefly recap what you learned in chapter 1 about some of the desirable characteristics your model should have. The two principal traits that describe our modeling paradigm are functional and reactive. When I say a model is functional, I mean that the model behaviors are implemented as functions with side effects clearly delineated from pure business logic. As you’ve seen, this helps the evolution of the model in a piecemeal way through function composition and enables you to reason about your model by using equational reasoning. When I talk about a model being reactive, I mean responsiveness in various forms—responsive to failure and responsive to varying load—and an overall architecture of the model that ensures the user is never a victim of unbounded latency.

2.6. Making models reactive with Scala

Functional thinking and implementing with pure functions is a great engineering discipline for your domain model. But you also need language support that helps build models that are responsive to failures, scales well with increasing load, and delivers a nice experience to users. Chapter 1 referred to this characteristic as being reactive, and identified the following two aspects that you need to address in order to make your model reactive: