locked
Entity Framework Advice RRS feed

  • Question

  • We are ready to embark on a new architecture for an existing application and before we leap into the swimming pool, I would like to hear some wisdom from people who have already done this.

    We are a 500 user application. We are sold on WPF and SQL Server 2008 for sure. We need to project the application on a few laptops, but for the most part, the users are connected. This application will be a rich client application and installed locally (nothing browser based.)

    My trepidation is in the middle. We will be using WF for business rules, but I am not sure which direction to go with the data technology. I like what I read about the Entity Framework (EF), but I have also read a bunch of complaints as well. Would it be better to write our own business objects and plumbing, or use the EF? Can we use WCF with the EF? We prefer stored procedures, so is that a problem with EF? Does EF work well in transactions?

    Would you use the Entity Framework/WCF in an n-tier environment or avoid it like the plague?

    I downloaded the Application Architecture Guide 2.0 document which is hot off the press, but did not find an absolute recommendation.

    Thank you for your advice!

    Michael

    Tuesday, December 16, 2008 7:14 PM

Answers

  • I have used the entity framework in a number of projects including ones that used WCF.  It is not as full featured as some ORMs (NHibernate) but is far easier to use and being a Microsoft offering is well documented with lots of examples (unlike NHibernate).

     

    EF allows you to map to stored procs. You support transactions through the Microsoft Distributed Transaction Coordinator (MSDTC).  see http://msdn.microsoft.com/en-us/library/bb738540.aspx for details.

     

    I wouldn't create my own DAL unless I had a specific requirement that ruled out other ORM's. 

     

    One reason to not use an ORM is performance.  ORM's give us productivity at the cost of performance and the mapping from object to relational may be an issue for some applications.  Highly transactonal web sites like ebay spring to mind. 

     

    As the productivity gains are so good I would use EF or another ORM until such a time there is a requirement they cannot meet (like performance).

     

    hope this helps

     

     

    Tuesday, December 16, 2008 10:32 PM

All replies

  • I have used the entity framework in a number of projects including ones that used WCF.  It is not as full featured as some ORMs (NHibernate) but is far easier to use and being a Microsoft offering is well documented with lots of examples (unlike NHibernate).

     

    EF allows you to map to stored procs. You support transactions through the Microsoft Distributed Transaction Coordinator (MSDTC).  see http://msdn.microsoft.com/en-us/library/bb738540.aspx for details.

     

    I wouldn't create my own DAL unless I had a specific requirement that ruled out other ORM's. 

     

    One reason to not use an ORM is performance.  ORM's give us productivity at the cost of performance and the mapping from object to relational may be an issue for some applications.  Highly transactonal web sites like ebay spring to mind. 

     

    As the productivity gains are so good I would use EF or another ORM until such a time there is a requirement they cannot meet (like performance).

     

    hope this helps

     

     

    Tuesday, December 16, 2008 10:32 PM
  • Thank you for your advice!

     

    Performance is always an issue, but for this application, we are only talking about 500 users and 10,000 "clients" (community corrections) per year. This is a 24/7 operation with lots of logging and scheduling management, so there will be a fair amount of transactions. But with limited staff, productivity is a higher priority.

     

    Have you handled disconnected users using EF as well? If so, do you recommend ADO Sync services or something else? We have about 20 users who may carry tablet PCs/laptops, so we need to be able to project the application out.

     

    Thanks again!

    Michael

    Wednesday, December 17, 2008 3:03 PM
  • I haven't had to cater for disconnected users.  If I did have that requirement the Microsoft Sync framework would be my first thought. 

     

    I doubt there will be any problems using the two in the same architecture.

     

    However, if in doubt there is a forum for sync framework; http://forums.microsoft.com/sync/ShowForum.aspx?ForumID=1912&SiteID=75

    Wednesday, December 17, 2008 10:44 PM