CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
   Explore    Item Entry    Profile    Invite   History    Resources   SiteMap  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML




Zone: > newsgroup > asp.net forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 7/18/2003 4:09:24 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 4 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
dave_m
Asp.Net User
class design w/DAAB7/18/2003 4:09:24 PM

0/0

I, too, have been using this for quite a while now and it does save a lot of code writing. I have developed a usage pattern that seems to work, although I'm not sure if it's such a great pattern in terms of maintenence.

I usually design classes representing a persisted object to pretty much replicate the schema of a table, and I give the classes methods such as Load, Save and a static List method. Each method has a corresponding stored procedure. So, within my Load method, for example, I set up an array of Output parameters, call SqlHelper.ExecuteNonQuery(...) and then set my object's properties to the the values of the output params.

If I need to make a change to the table schema, I then have to rework the code that builds the parameters, and usually have to change all the indices of the params array to make it match the sproc. I have thought about using the cached parameters functionality, but then - since the parameters are dynamically determined, I lose the ability to assign their values to class members explicitly, don't I?
The other option is using DataSets instead of objects with properties that match columns. But that seems like going back to the old RecordSet("columnName") days - I really like having strongly typed properties instead.

Comments?

Regards,
David
krome
Asp.Net User
Re: class design w/DAAB7/19/2003 11:14:36 PM

0/0

If you use a typed dataset instead of plain-vanilla dataset, there is strong typing of fields. It will "feel" much like you custom data interface classes since the typed dataset essentially is just a hierarchical series of classes that mimic the underlying database structures. Object instances are defined for rows, with typed properties for the columns. Basically the same thing you are coding by hand now from the sound of it...


Keith Rome


MCSD, MCDBA, MCAD, CIC

ghan
Asp.Net User
Re: class design w/DAAB8/7/2003 4:37:00 PM

0/0

This is good idea. I did it in this way sometime, but didn't think in this way. But, do you suggest that with using DataSet associated with DataTable, DataColumn and Rows could replace the custom object created by ourselves in BLL, somehow like using the MS DAL in different applications to replace the own developed DAL that is probably different for each application?

Or, how about to address the question: when it is suitable to use strong typed DataSet and when to use custom objects?


MCAD.NET (C#)


MCP on: SQL Server 2k Design&Iimplementation, Web Development (VI 6.0) and VB 5.0
3 Items, 1 Pages 1 |< << Go >> >|



Search This Site:





Other Resources:
ng.microsoft-news.microsoft-public-dotnet-languages-vb - Web ... How about: How do I attach a file to an email w/MailTo ... controls with non-visual elements won't display in design view (i.e. objectdatasource) ...
XML Help Please - macromedia.flash - Web Programming Newsgroups XML Help Please, > ROOT > NEWSGROUP > Adobe-Macromedia Forums > macromedia.flash, Date: 3/14/2008 1:56:39 PM, Replies: ... class design w/daab. how do you tell ...
Transaction Scope w/ DAAB not calling rollback as expected - MSDN Forums ... Transaction Scope w/ DAAB not calling rollback ... Answer Re: Transaction Scope w/ DAAB not calling rollback as expected. Was this post helpful ? ...
Microsoft Application Blocks - ASP.NET Forums ... W. 08-02-2003, 4:40 PM. 2. 1,547. SqlParameterCache Class. by ... class design w/DAAB. by dave_m. Re: class design... by ghan. 08-07-2003, 12:37 PM. 2. 1,740 ...
2006 September " Bila + Design ... I made this for my Drawing Class. What a great idea for a ... Daab. Design Addict. Design Museum London. Designboom. Dexinger. Marc Newson LTD. Moca Shanghai ...
2006 March 03 " Bila + Design ... was discussed in a class I attended earlier this week ... Daab. Design Addict. Design Museum London. Designboom. Dexinger. Marc Newson LTD. Moca Shanghai ...
Amazon.com: Door & Window Design: Antonio Corcuera: Books Buy this book with Door Design by Daab today! Buy Together Today: $51.72 ... Obama is such a Class Act. 2228. 1 hour ago. nonfiction. things liberals never ...
patterns & practices – Enterprise Library - Discussions The class library is the data access layer w/ references to the DAAB. ... stuff, it's going to make my design and deployment much more robust. ...
TheMSsForum.com >> Csharp >> Design patterns.. - The Microsoft Software ... ... error messages .I say this by an example first way: if(n<0 and w<0) MessageBox. ... Do they create a class on demand with all the necessary datatypes(because they ...
Place: The Care and Feeding of the Creative Class Building Design/Travel by Jeanette Winterson. Status Anxiety review by Jeanette Winterson ... Daab. victionary. Published Art Bookshop - Bookshop. WELCOME TO ...
Cranbrook Academy of Art, Designer in Residence: Scott Klinker 2006 Truss Furniture Collection Launch w/ Context Furniture at ICFF NYC. ... Design Head of the Class." HOW magazine (April 2003) 45-47. Kaneda, Sayoko. ...
Architecture, Interior Design - General: Books Results ... .com: Shop online for Architecture, Interior Design - General from an amazing selection of Books ... [W W Norton & Co Inc (10)] [Gibbs Smith (8) ... Class ...
 
All Times Are GMT