NHibernate

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fabiano

    NHibernate

    Please,

    i would like to know if there's a good idea use NHibernate at my programs
    besides native data tier of .NET.

    Java mans love it very much, but i don't know if its going to be a nice way
    in .NET

    You guys, what think about?

    Tks in adv
    Fabiano


  • Aquila Deus

    #2
    Re: NHibernate

    Fabiano wrote:[color=blue]
    > Please,
    >
    > i would like to know if there's a good idea use NHibernate at my[/color]
    programs[color=blue]
    > besides native data tier of .NET.[/color]

    I tried to use Hibernate for a web menu/permission management system a
    month ago. It's very convenient but not suitable for any complex
    things. In my case I was trying to create a table of menus and items
    which have foreign key references (parent menus) to the same table, and
    it simply crashes.

    Even if it doesn't crash, I wouldn't know how to optimize the db query
    performance. It brings another SQL-like query language, but only works
    within your Java code, thus you can't isolate the db part and test it
    alone.
    [color=blue]
    >
    > Java mans love it very much, but i don't know if its going to be a[/color]
    nice way[color=blue]
    > in .NET
    >
    > You guys, what think about?[/color]

    Unless your db stuff could be done in toy RDBMS like MySQL, it really
    sux. The more you use it, the more troubles you will find.

    After wasting three days on Hibernate I switched back to use stored
    procedures. I wrote down the API docs and implementation for SQL Server
    within a few days, no hassle at all, you get what you expect.

    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: NHibernate

      Aquila Deus <aquila_deus@ya hoo.co.uk> wrote:[color=blue]
      > I tried to use Hibernate for a web menu/permission management system a
      > month ago. It's very convenient but not suitable for any complex
      > things. In my case I was trying to create a table of menus and items
      > which have foreign key references (parent menus) to the same table, and
      > it simply crashes.[/color]

      Were you using a release build, or the most current development one?
      I've seen examples doing the same thing with no problems. Maybe there
      was a fault and it's been fixed.
      [color=blue]
      > Even if it doesn't crash, I wouldn't know how to optimize the db query
      > performance.[/color]

      That just means you need to learn to use Hibernate effectively. That's
      going to take time, but most effective technologies take a bit of
      learning to use effectively.
      [color=blue]
      > It brings another SQL-like query language, but only works
      > within your Java code, thus you can't isolate the db part and test it
      > alone.[/color]

      You can easily see the SQL which is generated, and look at that
      closely. If you can't get the best SQL from Hibernate, you can specify
      the SQL itself these days, but still get Hibernate to do the mapping.

      (Personally I avoid the HQL syntax for the most part and use criteria
      queries, so I'm even bothering to learn HQL.)

      Also note that if you keep your DB access separate from other business
      logic, you can still effectively isolate the DB part and test it on its
      own. The difference is that you're testing it in the same way that the
      rest of your code is going to use it.
      [color=blue][color=green]
      > > Java mans love it very much, but i don't know if its going to be a[/color]
      > nice way[color=green]
      > > in .NET
      > >
      > > You guys, what think about?[/color]
      >
      > Unless your db stuff could be done in toy RDBMS like MySQL, it really
      > sux. The more you use it, the more troubles you will find.[/color]

      Whereas I'm finding it to be *incredibly* helpful.
      [color=blue]
      > After wasting three days on Hibernate I switched back to use stored
      > procedures. I wrote down the API docs and implementation for SQL Server
      > within a few days, no hassle at all, you get what you expect.[/color]

      Well, there are certainly different needs and Hibernate won't be useful
      for all projects, but it's fantastic for the stuff we're doing - and
      will be especially so when we have to support Oracle as well.

      Note that my experience has only been with Hibernate though - I haven't
      tried NHibernate yet.

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • Peter Kirk

        #4
        Re: NHibernate

        "Aquila Deus" <aquila_deus@ya hoo.co.uk> skrev i en meddelelse
        news:<111432722 5.100464.291500 @z14g2000cwz.go oglegroups.com> ...[color=blue]
        > Fabiano wrote:[color=green]
        > >
        > > Java mans love it very much, but i don't know if its going to be a[/color]
        > nice way[color=green]
        > > in .NET
        > >
        > > You guys, what think about?[/color]
        >
        > Unless your db stuff could be done in toy RDBMS like MySQL, it really
        > sux. The more you use it, the more troubles you will find.
        >
        > After wasting three days on Hibernate I switched back to use stored
        > procedures. I wrote down the API docs and implementation for SQL Server
        > within a few days, no hassle at all, you get what you expect.[/color]

        I used Hibernate in a reasonlably complex project written in Java. There was
        a learning curve associated with Hibernate (certainly more than 3 days), but
        once you get past a certain point it is incredibly powerful and relieves you
        of a lot of database stuff (I hate writing all that SQL). Sure there is XML
        configuration etc, but I just loved being able to concentrate more on my
        Java objects than on the database side of things.

        I have never used (or heard of) Nhibernate before.

        Peter


        Comment

        Working...