Serious limitation of ObjectDataSource + DataObjectTypeName + DataSet as BusinessEntity

Discussion in 'ASP .Net' started by MTomov@gmail.com, May 24, 2006.

  1. Guest

    Hi fellas,

    has anyone managed to get ObjectDataSource to work Datasets where the
    Dataset is used as BusinessEntity class?

    What I mean is the following architecture:

    1.WebPage with ObjectDataSource
    2. CustomBusinessObject which
    * does validation,
    * uses a Strongly Typed DataTable as a collection of BusinessEntity
    items
    * forwards data access to DataAdapters as a data layer
    3. DataLayer based on DataAdapters

    Ideally I would like to use the DataObjectTypeName property of the
    ObjectDataSource
    so that the methods of the CustomBusinessObject are with a single
    parameter e.g.
    Insert (Customer c);
    The problem stems from the fact that the ObjectDataSouce requires the
    BusinessEntity class (in this case this would be strongly typed data
    row) should have a default constructor. Unfortunately, I could not
    figure way of implementing a strongly typed data row with default
    constructor.

    Is there any way around this situation?

    The only solution I could come up with so far is to not set the
    DataObjectTypeName and handle the ObjectDataSource's Inserting,
    Updating and Deleting events ... but this still requires a fair amount
    of trivial code.

    It would have been great if there was a way to plug into the creation
    of BusinessEntity instances instead of relying on default constructors
    ....

    Cheers,

    Millen
    , May 24, 2006
    #1
    1. Advertising

  2. Manu Guest

    Re: Serious limitation of ObjectDataSource + DataObjectTypeName + DataSet as BusinessEntity

    The ObjectDataSource isn't designed with extensibility in mind so you
    have to adapt to it.

    If you need more customization, you can use my ExtendedObjectDataSource
    that has more features and comes with full source so you can modify
    what you want:

    http://www.manuelabadia.com/products/EODS_features.aspx

    Right now to create the object it uses
    Activator.CreateInstance(dataObjectType) but you can change it to
    whatever you need.

    Manu
    Manu, May 24, 2006
    #2
    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. =?Utf-8?B?aGFwcHluaXUxOTg1?=

    Question about ObjectDataSource.DataObjectTypeName

    =?Utf-8?B?aGFwcHluaXUxOTg1?=, Jun 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    2,280
    =?Utf-8?B?aGFwcHluaXUxOTg1?=
    Jun 27, 2005
  2. Phillip Ian
    Replies:
    1
    Views:
    2,967
  3. Martin
    Replies:
    1
    Views:
    1,275
    Martin
    Jun 27, 2006
  4. Anabela Silva
    Replies:
    0
    Views:
    1,196
    Anabela Silva
    Nov 1, 2006
  5. Kernel Bling
    Replies:
    9
    Views:
    1,980
    =?Utf-8?B?VG9ueSBM?=
    Oct 2, 2007
Loading...

Share This Page