ObjectDataSource vs manual binding

Discussion in 'ASP .Net' started by Leon Mayne, Feb 6, 2008.

  1. Leon Mayne

    Leon Mayne Guest

    We have static functions in our data access layer that return generic lists
    of our business objects, such as this:

    Public Shared Function AllUsers() as Generic.IList(of OurUserObject)
    Dim colUsers as New Generic.List(of OurUserObject)
    ' Populate collection here
    Return colUsers
    End Function

    These methods are used thoughout the code, but in some aspx files we would
    like to have a drop down list which retrieves data from these methods (e.g.
    to allow the user to pick a user from the database). I've so far been using
    an ObjectDataSource control linked to the above method and a drop down list
    bound to the ObjectDataSource. This works fine. However, our senior
    developer has never used the built in 2005 data objects and does not like
    them, and prefers to do manual binding in the Page_Load event.

    Is it better in the above scenario to use to use an ObjectDataSource or to
    do the binding yourself? Can anyone cite any articles that give reasons why
    using the DataSource objects are a good or bad thing? Bear in mind this is
    an enterprise application, so simplicity is not really an issue.
     
    Leon Mayne, Feb 6, 2008
    #1
    1. Advertising

  2. Hello Leon,

    See there http://sgdotnet.org/blogs/chuawench..._-ObjectDataSource-versus-Custom-Binding.aspx
    for example

    I'm for the build-in objects, but if u are not using them as components on
    your forms :)
    I see there advantages that u relies on the existed classess which are the
    part of .NET FW and doesnt invent the wheel.
    it helps you extend your knowlege of .NET FW and improve the development
    speed reusing the standard classess

    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    LM> We have static functions in our data access layer that return
    LM> generic lists of our business objects, such as this:
    LM>
    LM> Public Shared Function AllUsers() as Generic.IList(of OurUserObject)
    LM> Dim colUsers as New Generic.List(of OurUserObject)
    LM> ' Populate collection here
    LM> Return colUsers
    LM> End Function
    LM> These methods are used thoughout the code, but in some aspx files we
    LM> would like to have a drop down list which retrieves data from these
    LM> methods (e.g. to allow the user to pick a user from the database).
    LM> I've so far been using an ObjectDataSource control linked to the
    LM> above method and a drop down list bound to the ObjectDataSource.
    LM> This works fine. However, our senior developer has never used the
    LM> built in 2005 data objects and does not like them, and prefers to do
    LM> manual binding in the Page_Load event.
    LM>
    LM> Is it better in the above scenario to use to use an ObjectDataSource
    LM> or to do the binding yourself? Can anyone cite any articles that
    LM> give reasons why using the DataSource objects are a good or bad
    LM> thing? Bear in mind this is an enterprise application, so simplicity
    LM> is not really an issue.
    LM>
     
    Michael Nemtsev [MVP], Feb 6, 2008
    #2
    1. Advertising

  3. It is neaither good or bad. One just needs to understand what it is and use
    it appropriately.

    xxxDataSource classes and declarative databinding are intended to make
    development simplier. Naturally, flexibility suffers as you don't have full
    control over databinding.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Leon Mayne" <> wrote in message
    news:...
    > We have static functions in our data access layer that return generic
    > lists of our business objects, such as this:
    >
    > Public Shared Function AllUsers() as Generic.IList(of OurUserObject)
    > Dim colUsers as New Generic.List(of OurUserObject)
    > ' Populate collection here
    > Return colUsers
    > End Function
    >
    > These methods are used thoughout the code, but in some aspx files we would
    > like to have a drop down list which retrieves data from these methods
    > (e.g. to allow the user to pick a user from the database). I've so far
    > been using an ObjectDataSource control linked to the above method and a
    > drop down list bound to the ObjectDataSource. This works fine. However,
    > our senior developer has never used the built in 2005 data objects and
    > does not like them, and prefers to do manual binding in the Page_Load
    > event.
    >
    > Is it better in the above scenario to use to use an ObjectDataSource or to
    > do the binding yourself? Can anyone cite any articles that give reasons
    > why using the DataSource objects are a good or bad thing? Bear in mind
    > this is an enterprise application, so simplicity is not really an issue.
     
    Eliyahu Goldin, Feb 6, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    6,953
    Guest
    Jun 28, 2005
  2. GaryDean
    Replies:
    3
    Views:
    9,562
    Luke Zhang [MSFT]
    Jan 10, 2006
  3. H5N1
    Replies:
    0
    Views:
    481
  4. Aykut Canturk
    Replies:
    1
    Views:
    371
  5. David Thielen

    ObjectDataSource method as another ObjectDataSource

    David Thielen, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    248
    Steven Cheng[MSFT]
    Mar 23, 2006
Loading...

Share This Page