views:

252

answers:

1

I have a query about the Microsoft's Enterprise Library Data Access Application Block and NHibernate.

We are in the designing phase of our Software of Anti Money Laundering.

The Criteria is as below:

We have Customer Class which contains Account Class in One to Many relationship. The model is as follows: Customer 1->M Accounts

The Classes are defined like:

class Customer 
{ 
   private:
      int CustomerID;
      string CustomerName;
      List<string> Addresses;
      List<Account> accounts; 
} 

class Account 
{ 
   private:
      long AccountNumber;
      List<Transaction> transactions; 
      Customer customer;
}

The Tables are defined like:

Table Customer
{
      int CustomerID;
      string CustomerName;
}

Table CustomerAddress
{
      int CustomerID;
      int Seqn;
      string Address;
}

Table Account 
{ 
      long AccountNumber;
      int CustomerID;
}

We have decided to go for Designing our Data Access Layer either with MSEL or NHibernate. So Can you guide me that:

  1. What are the Pros & Cons of either of these Strategies?
  2. Should we Combine NHibernate with MSEL?
  3. Should we go for our own designed ORM based strategy with MSEL?
  4. Or some other Strategy from you technical Architect?

Please help me in this regard: which strategy is best? Or provide any other strategy. Please give your rationale as well.

+2  A: 

This is a pretty broad question that doesn't make much sense because its comparing apples to oranges but I will attempt to answer some of it:

  1. NHibernate is an ORM, MSEL is a set of frameworks, those are the 2 biggest differences. NHibernate only requires you to create some POCO's and xml files to generate a DAL. When using the data application block in MSEL you will have to type out all the code for the DAL or use a 3rd party code generation tool like Code Smith.

  2. Combining them is a possibility but probably unnecessary in regards to the Data Application Block, you should really only need to use one or the other, NHib allows you to execute stored procedures so if there was something you couldn't do in c# itself you can always move it to a SP. As for the rest of the blocks(cryptography, logging, exception, etc..) in MSEL you could certainly use them with NHibernate.

  3. Designing your ORM is a very bad idea unless you have a huge team that can do it properly, even then I would just modify an existing open source ORM if there was some functionality you are missing.

  4. I would go with NHibernate or llblgen if you can afford it.

Element