which way? - TechRepublic
General discussion
October 16, 2002 at 12:18 AM
tarqs

which way?

by tarqs . Updated 23 years, 8 months ago

I am design ing a OO structure for a corp Intranet with ASP/VBscript (no com or .net as yet)

scenario

i have two over simplified db tables listed below.

employees
———
id
first_name
last_name

documents
———
id
title
body
author_id (ie. emloyee ID)

When setting up my classes i have seen the usual way to do this is to provide methods that extract the details i require from the table and returns as recordset (often with table joins). This works fine but invloves so many changes in the design.

On the other hand I have been loading each document record into the document object properties and accessing them through that. This allows me to set the author_id as an employee object and return the first_name and last_name without having to link the tables in my stored proc.

I haven’t seen this method before, is it regarded as to db intensive (although it separates the classes so well)? I obviously have many classes wanting to access the employee class and changes only have to made in one place.

Thoughts would be appreciated and more details at http://onestopsurf.com/builder.htm

This discussion is locked

All Comments