Is it just me, or am I slowing down? Yesterday was a busy day of programming, but there’s still a long way to go before this application is going to cut the mustard as an example for the course.
In the end, I went with the idea of a timesheeting application. Simple material keeps out of the way, and to be honest, there is so little logic or fancy presentation in this app that it could be changed from timesheets to another example in a relatively short space of time if need be.
Up and running, we have:
- A basic MVC3 app layout
- IoC set up to create controllers
- Data access with NHibernate
- Transaction management integrated with MVC
- Logging with the venerable log4net
- A skeleton for ‘pick-me-up’ domain events
It is the last item that I’ll be working on in depth today. ‘Pick-me-up’ domain events integrate domain models with external services in a way that plays better with IoC than the thread-static DomainEvents.Raise() pattern commonly seen elsewhere.
Dispatching events to handlers is also a good example of the ‘generic handler’ pattern that’s very widely used, and registering handlers will provide some further examples for convention-based/scanning registration.
To complete the day I’m aiming to polish up the last details of the basic MVC site (for example, error handling) and bed down an example of processing work in a background process to use in the “Resources and Units of Work” session. That leaves tomorrow and Friday for more detailed work on slides, some code samples for the “Containers” session, and some reworking of the example to fit into the flow of the course.
Will the demo app be available for download later on ?
If you can make it on the day I’ll have it to hand out. Afterwards I plan to put it online somewhere as a reference for Autofac (no surprise what container it will use) but not sure exactly where. Watch this space and I’ll post an update then
And ofcourse its going to be Autofac, didn’t expect anything else
But great, ill keep an eye out, got you in my RSS anyways.
Same for me, Australia is right on the other side of the planet, but this is clearly whetting my appetite! I’d be very grateful if we could get access to this presentation in some way or another.
[...] Designing a Short Course on IoC: Day 3 (Nicholas Blumhardt) [...]
[...] brief update today. Yesterday I think I covered everything I need to as far as demo app material goes, but tidying up, styling [...]
Hi Nick,
Did you ever write anything about “pick-me-up” domain events? I am interested as just ran into an issue with the DomainEvent.Raise pattern and lifetime scopes. There are obvious ways around it, but I hoped you had written something more elegant!
Cheers,
Ben
Hi Ben – there’s an implementation you can check out here: https://github.com/Readify/IocDevDay/tree/master/TinySheets/Eventing
Example of event being raised: https://github.com/Readify/IocDevDay/blob/master/TinySheets/Entities/TimeEntry.cs
Hope this helps!
NB