AngularJs web interface DDD project (SPA) ... is this a good idea?

I am starting to implement an enterprise application using DDD guidelines. First of all, my team and I begin our journey through DDD, so we have a lot of things to learn and understand (so forgive me if I say something ... stupid =>)

The application will be a (very customized) CMS. The project will have:

  • Domain and backend developed using the Microsoft stack (C #, WebAPI, EF6)
  • Front-End is designed as a SPA using AngularJs

My biggest doubts are related to how (and how much) it will be possible to use the domain in a rich client application ... I mean, if all the logic is in the domain objects (back-end side) how the relationship between FE and BE? Should the system do some kind of ping-pong game for all changes made to objects on the FE side?

Or should I compromise? Has anyone had a previous similar experience?

+5
source share
2 answers

You probably want to create an interface from a domain. Create client-side checks and calculations from your domain-side descriptions. Once it works, you can make your generator smart so that it starts using information about the amount of ping-pong required (and even the actual delay and throughput) to perform caching

+1
source

There is nothing in DDD that could prevent you from using it as a background for any user interface. Almost any system that is built using DDD, its back-end has a kind of user interface.

In particular, read more about user interfaces and REST. You will need the commands coming to your domain from the interface, based on the tasks that your users perform. You can perform a preliminary check, for example, required fields and data types, in the interface, as well as check the business and process commands in your domain. All communication is done using the REST API for your domain, which will be the adapter between your domain and the user interface.

In addition, SPA systems with the REST API are very suitable for CQRS.

Do not exchange your objects between FE and BE. Always get DTO for data transfer.

+1
source

All Articles