Doubts about Architecture (Application) RRS feed

  • Question

  • Hi, I'm from Brazil.

    I've some doubts about Architecture. I'dont know if I choose ADO.NET Entity Framework or Stored Procedures.

    If I choose Stored Procedures, I'll implement a Persistence Manager Class where I'll utility Reflection to get the properties and some informatition about
    the tables and fields (with Annotation). But, I know that I need to use Reflection and there are some problems with performance....There is another problem, because I need to implement the methods for example to get Childs from a Parent, implement stored procedures that receives code to get childs, etc, etc.

    If I choose ADO.NET Entity Framework, I'll have some problems with performance and tiers.

    I want to create 3 tiers (Access, Business, Apresentation (ASP.NET + Controller)).

    Tiago de Marchi Nunes - Consultor .Net
    Friday, July 3, 2009 5:38 PM

All replies

  • Tiago,

    There's a lot more to it than that.

    You need first to define what your requirements are.  What sort of loads will the application have, so we can judge how it needs to perform. 

    Is there any need to use EF, LINQ or any similar technology?  Is there any benefit to using it, other than 'coolness'?

    Why do you need to use reflection?  You can use reflection, but what for?  So dynamically you can find parameters?  The thing is, unless you've got some complex mapping system you will need to know the names of them anyway, so it is self defeating.  If there was a good reason for doing this, then you could cache the parameter list easily enough, thus overcoming all but the first call, performance-wise (not surethat it would have a massive effect anyway)

    You definitely need to be specific if you're asking how to overcome a real problem, otherwise generalised solutions is all we can offer here.

    I'd most certainly use sprocs unless you have a reason to use anything else.  EF has its benefits, but isn't as easy to control or performance tune, since the SQL that pops out due to the entity framework you can't easily do anything with.  This means that if there is a reason to have to performance tune, you have to be very good at writing LINQ queries to get the desired result, and you wouldn't be able to put any hints in there either. 
    That said, EF is a pretty good technology, and if you don't have any need to do anything particularly advanced, it can generally perform reasonably well.

    I think the reasoning behind EF would be if you want to be able to connect to multiple database backends, in a generic manner.  If you don't, then what's the reason for using it?

    I hope this gives you some ideas,


    MCSD, MCTS, MCPD. Please mark my post as helpful if you find the information good!
    • Marked as answer by Tiago Nunes Monday, July 6, 2009 11:58 AM
    • Unmarked as answer by Tiago Nunes Monday, July 6, 2009 11:58 AM
    Monday, July 6, 2009 4:44 AM
  • Thank you for answering me. I'd like using EF 'cause of the support to OO. Using stored procedures, I need to create the structure to resolve the INSERT, SELECT, DELETE and UPDATE. For example, I have one entity called Client and SpecialClient (specialized class). For Insert's Methods, I need to create 2 stored procedures to solve it (One for Client Table and another for SpecialClient Table). It´s the same to DELETE, UPDATE and SELECT. Is correct or no? You sad about cache to get in first time parameters through Reflection, Where Can I find the samples about this?
    Tiago de Marchi Nunes - Consultor .Net
    Monday, July 6, 2009 12:27 PM