Generic factoring for cross database functionality

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

    Generic factoring for cross database functionality

    Hi.

    Has anyone looked into generic factoring for making database
    independant applications?
    (Framework 2.0)

    I have, but I'm in the starting fase.

    What I do know is that if you only write code, you are able to make
    fairly database independant applications with not much more effort that
    if you wrote ie. only against SQL Server.

    BUT, and this is a big but, how on earth can we make use of all the
    wizards in Visual Studio when it comes to generating datasets, the new
    gridview etc. These operate only on data specific providers. Tihs
    stinx. I don't want to create all my data objects in code, it's much
    cleaner to drag some of them on the form designtime and set
    properties...

    Any views?

    I can't add the components in system.data.com mon to the tool pallette
    either...

    Thanx,

    Morten

  • Ward Bekker

    #2
    Re: Generic factoring for cross database functionality

    Hi Morton,

    You could use something like NHibernate (www.nhibernate.org). With this
    you can create a BO-Layer + Dal (NHibernate) that is database independend.

    --
    Ward Bekker
    "Asp.Net Discussions for the Professional Developer"


    "Free .Net 2.0 C# to/from VB.Net Code Converter"

    Comment

    • Joanna Carter [TeamB]

      #3
      Re: Generic factoring for cross database functionality

      "DelphiAddi ct" <Morten.Jacobse n@edb.com> a écrit dans le message de news:
      1143722442.8253 88.215270@t31g2 00...legr oups.com...

      | Has anyone looked into generic factoring for making database
      | independant applications?
      | (Framework 2.0)

      Certainly, I have written a very nice OPF (Object Persistence Framework) for
      ..NET 2.0.

      | BUT, and this is a big but, how on earth can we make use of all the
      | wizards in Visual Studio when it comes to generating datasets, the new
      | gridview etc. These operate only on data specific providers. Tihs
      | stinx. I don't want to create all my data objects in code, it's much
      | cleaner to drag some of them on the form designtime and set
      | properties...

      As long as you declare a wrapper class for a generic list type, then you can
      use these lists as valid data sources at design time.

      public class Customer
      {
      private string name;

      public string Name
      {
      get { return name; }
      set { name = value; }
      }
      ...
      }

      public class CustomerList : List<Customer> { }

      Try it.

      Joanna

      --
      Joanna Carter [TeamB]
      Consultant Software Engineer


      Comment

      • DelphiAddict

        #4
        Re: Generic factoring for cross database functionality

        Thank you very much Joanna.

        The thing is: I'm an experienced developer, but quite new to C# and
        ..net : So I'm not quite sure how to put your tip into some real code
        that helps me.
        I have made a Generic helperclass for myself, and this all works fine.
        The components on the component palette is all provider specific. How
        do I "publish" a provider that is based on some generic code?

        I can see from your previous answer that you know how to do it. I would
        be VERY pleased if you could make a small dummy example for me...


        Thanx,
        Morten

        Comment

        • Joanna Carter [TeamB]

          #5
          Re: Generic factoring for cross database functionality

          "DelphiAddi ct" <Morten.Jacobse n@edb.com> a écrit dans le message de news:
          1144043523.4027 32.257320@g10g2 00...legr oups.com...

          | The thing is: I'm an experienced developer, but quite new to C# and
          | .net : So I'm not quite sure how to put your tip into some real code
          | that helps me.
          | I have made a Generic helperclass for myself, and this all works fine.
          | The components on the component palette is all provider specific. How
          | do I "publish" a provider that is based on some generic code?
          |
          | I can see from your previous answer that you know how to do it. I would
          | be VERY pleased if you could make a small dummy example for me...

          What do you mean by publish ?

          Joanna

          --
          Joanna Carter [TeamB]
          Consultant Software Engineer


          Comment

          • DelphiAddict

            #6
            Re: Generic factoring for cross database functionality

            My original question was: I have written database independant code with
            generic factoring in ado.net 2.0. I also want to work with database
            independant components design time. Just drag them from the component
            pallette and use them.

            It seems you answered this question a few posts up. The problem is that
            I didn't quite understand how to work with your answer...

            That's why the post above.
            I took understood your answer as you've been making components you can
            use design time (And for a Delphi Developer with components I mean
            components you drag from the tool pallette onto a form or datamodule)
            So, is this how you have done it - or have you done it another way?

            I would very much like to work with design time components - there is
            so much functionality in creating things design time with these new
            components. The problem is that when working with these components I
            work provider spesific, which I don't want to do...

            Did this help... ?

            Thanx again,

            Morten

            Comment

            Working...