Tech Off Thread

17 posts

Persistence Framework in .NET

Back to Forum: Tech Off
  • User profile image
    amit_trehan

    Hi Friends,

    Besides normal ADO.net API based persistence, what are the other persistence frameworks commonly used in .net ? How popular and safe is to use NHibernate? What are the other frameworks available?

    Should we use normal ADO.net API based persistence mechanism or a persistence framework like NHibernate? Please share your experiences and recommendations.

    Thanks,
    Amit

  • User profile image
    olmobrutall

    be brave and use linq! zillion times better than hibernate.

  • User profile image
    amit_trehan

    But Linq is fairly new and not tried and tested. Can you please forward me some case studies and the approach how to implement it.

  • User profile image
    stevo_

    For LINQ you of course need at platform that can support .NET 3.5..

    I wouldn't carry any real concerns with LINQ being new..

    Other than that, nhibernate is the best ORM I've used so far.. it may be daunting at first writing mappings and so on, but its actually pretty simple..

    It's much better than a lot of ORMs now that tend to pollute the objects they are designed to help persist (such as inheritance or interface requirements).

    As well as this, I'm sure nhibernate now has an extended feature that allows you to create your mappings in code by using attributes..

    (rather than xml configuration files).

  • User profile image
    amit_trehan

    I am working on 2.0 framework, so the option of using LINQ is no more there. But apart from that there are other ORM tools like iBatis.

    As both of them are coming from java family is there any major difference in them, or they perform similarly.

    And what are the performance overheads of using these persistence frameworks.

    Somewhere I read that MS was also suppose to come with Object Space in VS2005. Is there anything like that in VS2005, becasue I can't see it anywhere.

  • User profile image
    JChung2006

    amit_trehan wrote:
    Somewhere I read that MS was also suppose to come with Object Space in VS2005. Is there anything like that in VS2005, because I can't see it anywhere.

    ObjectSpaces is not available for Visual Studio 2005.  It's called LINQ for Entities now, and the ADO.NET team has been working on LINQ for Entities for Visual Studio 2008 and .NET 3.5.

    There are several third-party persistence frameworks for .NET 2.0 like nHibernate, Opf3, Subsonic, NetTiers, LLBLGen Pro, Wilson ORMapper, Gentle .NET, etc.

  • User profile image
    stevefuzzy

    I gave IdeaBlade DevForce a shot.  They have a free Express edition.  I was quite impressed.  Once you get past the learning curve, it's quite easy.  It has tools to automatically create object mappings to relational entities, so you don't have to deal with manually coding up XML files ala Hibernate.

    The user manual alone is worth reading.  It has a good discussion of many issues facing developers when dealing with ORM in general, and I like their development philosophy.

    It won't work with Access MDB files, though.  You'll need SQL Server, or one of the other supported db servers.

    Of course, if you want the full featureset, you will need one of the commercial editions.

    See http://www.ideablade.com/index.html

  • User profile image
    Rossj

    olmobrutall wrote:
    be brave and use linq! zillion times better than hibernate.


    Does hibernate allow you to detach and re-attach entities?

  • User profile image
    amit_trehan

    If we talk about only open sources , then I believe iBatis and NHibernate are the candidates.

    Can anyone comment which one of these is beeter and why??

    And the second question that remain unanswered is what are the performance constraints of these persistence frameworks?? Please shed some light on this as well.

  • User profile image
    mierrosamir

     creating  dataAccessLayer

    check the next links and see what is suitable for u

    Nolics:
    http://www.nolics.com/index.aspx

    NDO:
    http://www.netdataobjects.com/portal/?TabId=36


    Persistent Database:
    http://www.lastcomponent.com/index.php?page=products/features/main&left=left


    EntitySpace:
    http://www.entityspaces.net/Portal/Default.aspx

     I suggest Nolics but if u haven't time to learn how to deal with Nolics queries, check Persistent Database.

  • User profile image
    amit_trehan

    Guys, thank you very much for sharing information about som many tools.

    But the second part of the post about the performance of these frameworks is still untouched, I really want to know the performance constraints of this approach.

    Please share some thoughts on this as well..................

  • User profile image
    littleguru

    Mine: www.opf3.com Smiley

  • User profile image
    amit_trehan

    Hey Guys, let me complete the picture. I have an .NET 2.0 windows app thats gonna talk to Siebel web services. And the app is deployed on the citrix server.

    There are lot of things happening on the UI of the app that requires different set of data. So for every change I cant call a Siebel Service to get me the data, it will hit the app performance as the data being asked for is quiet huge.

    So I am looking for a persistence framework that can hold the data for me.

    Can anyone please validate the approach?

    And also the same question as above how these frameworks itself will affect the app performance?

    PS: Open Sources please

  • User profile image
    figuerres

    amit_trehan wrote:
    

    Hey Guys, let me complete the picture. I have an .NET 2.0 windows app thats gonna talk to Siebel web services. And the app is deployed on the citrix server.

    There are lot of things happening on the UI of the app that requires different set of data. So for every change I cant call a Siebel Service to get me the data, it will hit the app performance as the data being asked for is quiet huge.

    So I am looking for a persistence framework that can hold the data for me.

    Can anyone please validate the approach?

    And also the same question as above how these frameworks itself will affect the app performance?

    PS: Open Sources please



    Well if you key issue is that you are pulling data from a remote server and want to in effect "cache" that data then what about a local sql server that's running in the same box as the citrix server?
    or one next to in in the same data center?

    do you have xml scemas for the data that comes back from the web service calls ??
    use SQL 2005 it supports storing xml and can search and index the data... then create a table or tables to relate the data to the call that got the data and wrap your calls with a class that checks for a local copy of the data and returns that when it's located and calls the web service and saves it in the sql db when it has to get it the first time.

    do that right and I bet you get the right performance and really very little code to make that work.

    let SQL persist and index the data.
    let your proxy handle fetching and storing the data.
    done.

  • User profile image
    amit_trehan

    figuerres wrote:
    
    do you have xml scemas for the data that comes back from the web service calls ??
    use SQL 2005 it supports storing xml and can search and index the data... then create a table or tables to relate the data to the call that got the data and wrap your calls with a class that checks for a local copy of the data and returns that when it's located and calls the web service and saves it in the sql db when it has to get it the first time.


    If you can explain the approach in more details that will be great.

    Thanks,
    Amit

  • User profile image
    figuerres

    amit_trehan wrote:
    
    figuerres wrote:
    
    do you have xml scemas for the data that comes back from the web service calls ??
    use SQL 2005 it supports storing xml and can search and index the data... then create a table or tables to relate the data to the call that got the data and wrap your calls with a class that checks for a local copy of the data and returns that when it's located and calls the web service and saves it in the sql db when it has to get it the first time.


    If you can explain the approach in more details that will be great.

    Thanks,
    Amit


    if I have time later I will try to answer more questions but please start by
    1)  are the sibel web services xml based? soap? or ????
    2)  if they retrurn some kind of xml how many different xml formats do you need to read?
    for example, Invoice, Quote, Workorder --  that would be 3

    3) do you have access to sql server books ononline? (comes with sql or you can download from msft web site)

    read up about sql 2005 and xml features....

    you can manage the data several ways, not sure which is best in yur case ....  but for example you can define a sql column as type XML
    and store an xml doc or fragment in that.

    you can be more detailed and if you provide a schema then sql server can use that to allow you to query the xml using a mix of xquery and sql.

    so then just determine how you pick between saved data and fetching new data from a web service.

    setup sql tables and save data to sql....

    which no matter what framework you get you still have to make that part; when to use saved data Vs. get new data.

  • User profile image
    zhuo

    I've worked with SubSonic in a recent project and it's an absolute pleasure to work with. Zero configuration for ORM mapping and low learning curve.

    The learning curve is about 1 day if you put your effort into it. If you need longer than 1 day either IM me or leave a comment in my blog and I will write you something that will get you through the learning curve quickly. Check it out at subsonicproject http://subsonicproject.com/

    Sorry for digging up this old post but I thought it appropriate to leave a note in this post since other people has left good suggestions.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.