I have been reading about the Domain driven design lately but I rarely see it in the web applications(or I may have failed to google it), I think we now have enough complexity to deal with in web application too.
I need a way to keep my models and business logic clean and least coupled and framework/library agnostic. For example today I am using AngularJS and tomorrow I may switch the UI to ReactJS.
Having said that I am trying to learn this with a simple example. Suppose I am trying to create Quote application with the following features:
Given a Quote
Given an User
When not logged:
When logged in:
I am interested in how the above requirements can be achieved in keeping UI and business logic clean and separate.
I am not an expert but at present I can come with these requirements which may well change in future.
What is Front End Development? Front-end development otherwise referred to as client-side development, uses JavaScript, HTML, and CSS languages to build web applications that users can use and interact with. This domain revolves around the look of a website and how the design is implemented.
Domain Modeling is a way to describe and model real world entities and the relationships between them, which collectively describe the problem domain space.
A domain model contains conceptual classes, associations between conceptual classes, and attributes of a conceptual class. "Informally, a conceptual class is an idea, thing, or object". The model is shown as a class diagram.
A domain model describes the domain types that an organization allows and their constraints. Using domain data types instead of base data types ensures that you maintain consistency across an organization, and allows reuse of common data type definitions for greater team efficiency.
You should implement MVC patterns both in the front-end and in the back-end(server side). For clean separation of responsibility and also team resources/expertise(api developers, UI developers), you can have the business logic exposed via REST APIs and the UI development using various client-side technologies (e.g angular, cordova, react, etc).
UI developers should be able to develop in isolation without the API. They will have to create their own Models, Views and Controllers (MVC). Similarly, API developers should be able to develop the business domain and expose the necessary operations (e.g CRUD) required by the business or the ubiquitous language. The API layer will have its own Models, Views and Controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With