SPA Conference session: The Power of Events

One-line description:A look into the multidimensional capabilities of events
 
Session format: Long tutorial [read about the different session types]
 
Abstract:Event driven architecture is gaining in popularity. Reactive programming is quite often said to cause less headaches than imperative approaches. However, events can be used for so much more. In this tutorial, we explore a lot of the benefits that events give us - from decoupling, integration, and communication to lesser known (but quite a bit more impressive) ones like domain modelling, specification, and as a data storage mechanism. Auditing, scalability, and migrations are other interesting areas where events can have an impact. In this tutorial we will see how we can reap these benefits, using clear and simple examples.

Please bring a laptop with VirtualBox installed. A virtual machine with the necessary software will be provided. It would be even better if Vagrant is installed alongside VirtualBox. The guest operating system will be Windows Server 2008 R2 x64. As such, please ensure CPU virtualisation (VTX) is enabled in the BIOS. About 40GB of free space will be required for the VM. If you don't want to use the VM (or want an alternative if things go wrong), please have a Windows machine with Visual Studio 2012+ and Sql Server Standard / Express (2008 R2 or 2012) installed. We'll be pairing up in any case.
 
Audience background:Some programming experience in C# or Java can help, but is not necessary. Experience as a developer or architect will be beneficial.
 
Benefits of participating:You will gain hands on experience in exploring the powerful features that events can provide us in software engineering.
 
Materials provided:Instructions for the exercises, and code for a simple event store (open source), a framework to work with it, and a testing harness for the specifications.

The coding parts will use some simple libraries that will be provided. I am polyglot these days, but have pretty much everything needed done in C#. I'll likely prepare a windows virtual machine that attendees can use during the day. All that would be required would be virtualbox and vagrant installed, and a simple vagrant up. If you feel the need, java libraries may also be provided, however, anybody with a java background should be able to use the C# library, as it (the library) has a simple api. The vagrant approach should result in minimal problems in software set up during the course. The vagrant box provided will consist of:

Windows 8 Trial Edition
Visual Studio 2013 Express / Trial
Sql Server 2012 Express
An event store set up in Sql Server
Relevant VS Solutions for the exercises
 
Process:Interactive discussions and hands on exercises.

 
Detailed timetable:00:00-00:30
Discussion: A brief overview of Domain Driven Design, and introduction to Domain Events

00:30-00:45
Break

00:45-01:00
Discussion: Modelling with messages.

01:00-01:45
Group Exercise: Modelling a domain using messages. Groups will explore a representative domain, identify domain events, and commands. They will identify information flows, and add payloads to their events and commands. From there, they will look at identifying aggregates with a view of achieving good cohesion. This is along the lines of Alberto Brandolini's Event Storming approach.

01:45-02:00
Break

02:00-02:25
Discussion: Messages in Testing. We will discuss how events and command can be used to specify systems, and their role in representing use cases as data. Once represented as data, the specifications can be used to drive automated tests, and generate documentation. This is an interesting take on behaviour driven development.

02:25-3:00
Coding Exercise: Event Driven Testing and Documentation. We will take one of the message flows from the previous exercise, and code some specifications with them. Participants will use a lightweight library provided. We will use a simple program to generate documentation from the specifications. We will then wire-up the specification to the library to make them executable. Things will be kept nice and simple - the focus is not on practising TDD (or BDD), but rather getting an understanding in what's involved in message oriented testing.

3:00-3:15
Break

03:15-03:45
Discussion: Events as a storage mechanism. The concept of event sourcing will be put forward, and we will look at some code to help understand the concept in regards to aggregates. We will discuss what's involved in using events as storage in real world applications.

3:45-4:15
Coding Exercise: Events as Storage. We will use a library and hook to to an in memory event store. We will implement some specifications created previously. We will then switch to using a sql event store which will result in persisted storage.

4:15-4:30
Break

4:30-4:50
Discussion: Projections. We will discuss how we can use stored events to build viewcaches for querying. We will cover topics like how to get stored events over to projections, technologies to do so, push vs pull, ReST, simple and complex event processing, etc.

4:50-5:15
Coding Exercise: Projections. We will build a few simple projections. This is vast topic in itself, and only the basics will be covered.

5:15-end
Discussion on miscellaneous topics not already covered. For example, while we will have already discussed some scalability, consistency, concurrency, etc. issues, we will dive deeper.


The timelines are flexible, and some re-allocation will be done on the fly based on audience interests.
 
Outputs:A sample implementation of a project using events for storage, specifications, integration, etc.
 
History:I have delivered sessions and tutorials with similar content at various national at international conferences and user groups.
 
Presenters
1. Ashic Mahtab
Heartysoft Solutions Limited
2. 3.