mardi 4 octobre 2016

Domain models in front end

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

  1. Can be upvoted / downvoted.
  2. Can be starred.
  3. Can be created by User (Goes in the review Queue).
  4. An user can share it via (Twitter, Facebook etc).

Given an User

When not logged:

  1. Can see random quote.
  2. Can upvote / downvote a quote.
  3. Can search a Quote by Title or Author.

When logged in:

  1. Can create a Quote.
  2. Can star a quote.

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.




Aucun commentaire:

Enregistrer un commentaire