Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OO Design and DAO

Status
Not open for further replies.

oj75

MIS
Aug 7, 2002
53
US
I'm just starting to wrap my mind around application programming from the OO perspective. I've been asked to attempt to design and implement a small web application based on OO prinicipal. All previous development was completed by a third party group of programmers who chose to not include a business object layer into the development process.

I recently purchased a couple of books to help get me started: Beginning C# Objects by Barker and C# adapted version of the GoF Design Patterns book. I have to admit with little to no background in OO design I attempted to read the Design Patterns book and realized it was a tad over my head. I decided to get my feet wet with Barker's book and have learned enough over the past few weeks to get a decent handle on how to determine and model my domain class objects, attributes, and behaviors.

Currently, the presentation layer(aspx pages), within our existing application, talks directly to the DAL(made of DataAccess component and DataSet classes) via the C# code behind pages for each. Over the past year I've been maintaining this structure. Now on entirely new project I'm being asked to design and implement an additional layer in addition to the presentation and DAL layers, and I'm having trouble understanding how to connect them. Oh yea, did I mention I'm working on my own as my non-profit employer can only afford one programmer at this time. Fun! Fun!
I have a many questions regarding the problem I've been given but here are just a few:

1. On a high level is creating data access component classes made up of DataAdapter objects, Command objects, and sql statements which are mapped to datasets and talk directly to my SQL Server 2000 database the proper way to constuct a DAL? If not where can I find instruction/examples on the proper way to construct the DAL?

2. What is the role of data access objects in OO design? Are these purely DAL components? Or if I have a domain class which potentially has a collection of records as an attribute is it alright to create this collection as a DataTable or an array of DataRows?

3. I'm probably completely off on #2, where can I find instruction/examples on the physical implementaion of OO model? I'm not understanding how I'm going to physically get data out of the DAL into my objects and then get that data out of my objects and presented to the GUI.

4. Currently, DataSet objects are instantiated in the aspx code behind pages and datatables, within the dataSet, are bound to controls like datagrids and datalists which works very nicely. How is this done when working with objects and collections of objects?

Sorry about the longwinded post, but I need someone to check my understanding before I go any further.

Any information is appreciated.

OJ
DB/.Net/CR Developer
 
If you really want to go the OO route (and you should with .NET) at some point you will need to map your objects to your database tables. It can get complicated, especially when you take into account transations and concurrency. After trying out various ways to code a fully object-oriented Data Access Layer, I have come to the conclusion that the use of an Object Broker is the best solution, as in generic, O/R Mapper. This topic is feverishly debated daily over at the ASP.NET/Architecture forum.


There are also some OK documents from MSDN, which will get you started.


and


As for books, we can learn a lot from the Java world. I'd recommend Scott Ambler's Building Object Applications that Work, and C# Class Design Handbook.

HTH



[pipe]
 
Hello every one,

I am working on a paper to assess the real benefits object oriented technology brought to IT industry. Can any one help me by providing reference information. Thank you

Abrillo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top