Application Layering

A good layering diagram:

In my mvc I skipped the service layer and the actions were marked with Spring.NET [Transaction] attributes.

After a response from Mark Pollack at Spring.NET I can see that this is probably not such a good idea.  He mentioned instead of using the service layer

(ie. a transactional service layer, WCF, or web services).  In my case, a transactional service layer would fit well.

That being said, my refactoring would be to move my calls to the Dao from the Controller->Actions into a service layer.  This would provide a better separation of concerns as well as decouple the controller from the dao – allowing me to use another UI technology (ie. Silverlight, or WPF/WinForm) which would utilize the same service interfaces. 

This picture is worth a 1000 words:

One question I have is the box ‘Domain objects’ – I know it’s not maybe the best approach, but I have used my POCO objects as my domain model.

This architecture would possibly require me to use a more ‘disconnected’ approach with NHibernate ?


One thought on “Application Layering

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s