Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

Me & the Onion Architecture

leave a comment »

Jump into ASP.NET MVC 2 in Action Chapter 23 which talk about an integration of ASP.NET MVC and NHibernate the author introduce us to the Onion Architecture.

Using this architecture we simply structure our solution like:

  • Core, storing POCO & various Interfaces
  • Infrastructure, talking with underline or external system
  • IntegrationTests, generally speaking this would test Infrastructure functionality
  • UI

Let focus on the Infrastructure because it is the main actor in this architecture; the following role given to this layer

  • Mapping between Core class & Database by talking through NHibernate (I agree)
  • Responsible for injecting NHibernate session into web session with NHibernateModule: IHttpModule (I agree)
  • Contain abstract RepositoryBase<T>: IRepository<T> (I agree)
  • Contain all Interfaces  implmentation hmm ? isn’t it too much for an Infrastructure? what about
    • Core
    • Infrastructure
    • Services
    • IntegrationTests
    • UI

I will do more investigation (Pros, Cons) but love to hear your take on this, if you haven’t read the chapter yet do it now.

Advertisements

Written by Chorn Sokun

July 25, 2010 at 2:35 pm

Posted in Uncategorized

Tagged with ,

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: