IBlog<Johan>

This and that in a developer's life in general

News

Follow johandanforth on Twitter

Random Links

Walkthroughs and Tutorials

Please Feedback! Unity, nHibernate, Fluent, Linq... Trying New Architecture Combinations

We're thinking about a new architecture for a set of pretty large WCF (and perhaps also REST) services that's going to be developed during the next year and perhaps you dear reader would like to comment!

The services themselves are pretty straight forward, we're going to serve data from a huge SQL Server database which unfortunately is old and lacks relationship/fk/pk between most tables. Nothing we can do about that I'm afraid but we thought that nHibernate could be a good way to map data to domain objects. Some of the services will need to handle more complex business rules, but no heavy computing or long running stuff (not atm anyway).

What more can I say... everything is going to be running on .NET 3.5, and we have a pretty good view of the business domain, we're currently modelling the information/domain together with the customer and we will probably be developing the whole thing in a DDD-ish way, using unit and integration tests, IoC...

So, currently we're thinking of WCF/REST for the service layer, Unity as container and building something around nHibernate for the Repository (looking at the IRepository implementation in Fluent). We're new to nHibernate but have been looking at nHibernate.Linq which looks really nice, and I think we'll use the Fluent API and map the classes in code instead of using XML configuration (which I'm allergic against). Just have to figure out a good way to make it all fit together, especially to get a decent UnitOfWork to work with the nHibernate session and the repository. I'll see what I come up with and post it here.

Ideas? Please comment or send me an email of you like.

Posted: Dec 17 2008, 02:04 PM by jdanforth | with 3 comment(s)
Filed under: , , ,

Comments

JV said:

I have recently used the combination WCF, NHibernate and Unity (amongst other EntLib components) and it works very well. But keep a few thing in mind: Any ORM (so also NHibernate) has it limits in retrieving large amounts of data. So you'll need to check if the situation you describe can handle it well enough (In most applications it ain't a problem).

Unity is easy to set up in the web.config through the EntLib configuration, it worked very well for us.

Bare in mind that NHibernate.Linq is still in development, I wouldn't suggest you to use it yet for production environments. If you are 'allergic' to the XML mappings (I wouldn't know why though), have a look at ActiveRecord, it gives you attribute based NHibernate mappings. I would prefer that to any other form of code mappings (But that's like your XML thing a personal preference ;)).

# December 17, 2008 1:17 PM

Johan Danforth's Blog said:

This blog post is to continue on the one I wrote a few days ago about a new architecture for a WCF project

# December 19, 2008 3:36 PM

Johan's Blog said:

This blog post is to continue on the one I wrote a few days ago about a new architecture for a WCF project

# December 19, 2008 3:36 PM