Showing posts with label Domain Events. Show all posts
Showing posts with label Domain Events. Show all posts

Friday, 19 November 2010

Domain events and Growl!

Today we came across a really really sweet side effect of an event driven architecture. We were integrating a jquery growl plugin to give nice 'no ok button' notifications to the users when they click on transaction buttons (Save, Relase Order etc etc), when we thought "wouldn't it be great if the front end was not responsible for the notifications, but rather the infrastructure that is used to raise the events on the back end that make everything happen keep a list of what events have happened during the transaction".

This has a couple of nice side effects:
  • The front end does not have to have any real knowledge what this button actually does. But..
  • The user gets fantastic visibility of what pressing that button actually did! 3 Growls: Timesheet approved, Customer invoice line created, Email sent to employee... All on one button click.
  • No additional code to write! It is just part of the infrastructure.
This is made possible due to the CQS nature in which the browser communicates with the server in the hiJump infrastructure pattern we use. In a future post I will go deeper into this as the CQS approach is working out very nicely for use and greatly simplifies the relationship between the views and the back end.

Until next time.