How can you update a data record (or set of records) without passing in the 
changed information as parameters?

Christopher Reed
Web Applications Supervisor
Information Technology
City of Lubbock
[EMAIL PROTECTED]
"The oxen are slow, but the earth is patient."

>>> [EMAIL PROTECTED] 4:12:38 PM 7/6/2005 >>>
In a Business Layer with Busines Entities with CRUD Behaviors (has described 
here [1] at Cap. 'Defining Custom Business Entity Components with CRUD 
Behaviors') typically
1) the Update() method have zero parameters
2) the Update() method is in a Business Entity class say Author, while the 
SelectAuthorsByXxx() methods that get filtered lists of authors is in another 
Business Entity say Authors class.

But... ObjectDataSource:
1) don't let me set a method with zero parameters to UpdateMethod!
2) don't let me set SelectMethod and UpdateMethod from 2 different classes!

To use ObjectDataSource in real world application I had do write a wrapper like 
this:

public static class AuthorsWrapperForObjectDataSource {
    public static List<Author> SelectAuthorsByState(string state, string 
sortExpression)   {
        return AuthorsList.GetAuthorsByState(state, sortExpression);
    }

    public static int UpdateAuthor(Author author) {
        return author.Update();
    }
}

I have to write a wrapper for ObjectDataSource also when I have a Business 
Layer with Busines Entities without CRUD Behaviors (has described here [1] at 
Cap. 'Defining Custom Business Entity Components').

Am I missing the correct usage of ObjectDataSource or someone else noted these 
ObjectDataSource limitations?

TIA (luKa)

http://nullabletypes.sf.net/ 
http://dev.luca.minudel.it/ 
http://www.luca.minudel.it/eng/ 


[1] Designing Data Tier Components and Passing Data Through Tiers,
Microsoft, 2002
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/BOAGag.asp

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to