Any JS infrastructure for a system using CQS?

I am creating (or trying) an application that follows DDD, and therefore I use CQS (like Command Query Segregation, no Event Sourcing).

I also know a lot about the JS Framework (knockout, spine, angular). And this framework is much CRUD oriented. If you separate your team and request, the model at the GUI level does not make sense: you either buy an order (team) or request a report on the sale (request), you are not creating an order or not requesting an order. Or โ€œbuyingโ€ is not really an HTTP verb.

So, I wonder if there are any frameworks that could simplify:

  • Command / request validation (I am using asp.net mvc3 I think I will do it with a DataContract though)
  • Command / Request Transfer
  • Linking commands / requests with gui
  • templated
  • event aggregator

Perhaps more ...

What do you think?

+7
source share
3 answers

You might be interested in backbone.CQRS https://github.com/jamuhl/backbone.CQRS

Combines CQRS power with core network.

There is even a sample for CQRS with a base. CQRS (nodeJS Sample) https://github.com/jamuhl/nodeCQRS

->, even if it is not interesting in nodejs, these samples demonstrate the use of trunk and backbone.cqrs

+3
source

I do not think that this will be so, because this is all uneven (although necessary) functionality.

But for imho best practices:

  • command check: jquery.validate (do not forget to also check on the server)
  • request verification :? (server check should be sufficient)
  • sending command / request: what more do you need than ajax with some wrappers
  • command / request binding with gui: do you mean bi-directional CRUD style forms? I used DForm.js to create forms from json. + I have custom code using data attributes to restore json from updated form in post (ajax)
  • templating: hogan / mustache etc. The main reason I switched to the clientisde MVC route (trunk or spine.js in my case) should have a DRY template (client / server). Recently, I deviated from this solution and instead decided to render html fragments / fragments on the server and return it to the client instead of returning json and forcing the client to make templates. This is primarily due to performance considerations: for example, implement "infinite scrolling" and test it in IE8 or lower, and see how you are still satisfied with your client mvc.
  • event aggregator: socket.io (master of its own), pusher (external), etc.

I know, not what you asked, but since I'm pretty sure that what you ask does not exist, I decided that I would give you my opinion.

Hth

+1
source

Disclaimer: I am one of the authors of the product mentioned in this answer, but as I try to answer the question objectively, do not put my answer as spam or its downvote. If you donโ€™t like something about my answer, leave a comment so that I can update and improve it.

There is wolkenkit , which is the basis for CQRS, DDD, and the event source and is built using Node.js. It provides a technical frame for launching your applications and implements the above concepts in a general way. Thus, you can describe your domain logic without creating the entire technical basis for yourself.

You asked for things like how to handle commands and queries easily. wolkenkit does just that. It also provides a client SDK that makes it easy to access your application firewall from the interface, without having to worry about technical details.

In the end, it lets you focus on the aspects of the domain that make up your application. So maybe itโ€™s worth a look. If you need more information, look at the website or the documentation .

0
source

All Articles