OO and RDBMS design decision



Say for example I have a Computer class has a table that contains the
information about a basic computer (ie serial number, make, model), and
there are other tables such as one that relates the serial number to a
network name, and another that relates the serial number to an employee
payroll number (for computer allocation), and then an employee table that
contains (payroll number, name).

Is it better to have one class representing one table (DAO), and then
another class that retrieves the necessary information from various tables
to build my object? - so ComputerFactory would request information from
ComputerDAO, NetworkNamesDAO, AllocationDAO and EmployeeDAO. (The DAO
classes contain the actual SQL queries)

Or should I simply go for one class that does both jobs in that it queries
multiple tables to build my object? So ComputerFactoryDAO would create and
return Computer objects after querying all the tables.

On the one hand the first option seems more versatile in that I could reuse
the DAO classes for other queries. On the other hand the second option is
simpler.

I would appreciate some thoughts on this.

Best regards,
Rich.
.



Relevant Pages

  • Re: Run action query in back-end from front-end database
    ... whatnot in the back end database. ... The queries are housed in the back end ... The reason I have the upload tables in the back end is that it will be on ... Rick's code uses DAO, and Access 2000 doesn't have a reference set by ...
    (microsoft.public.access.externaldata)
  • Re: Why use relational tables in OO (please just take a look inside)
    ... >>literally lay the data structure out in memory as a single class ... Checking SSN duplication is done once per Employee but there ... Another is to support ad hoc queries ...
    (comp.object)
  • Re: Comparing the Results from two queries
    ... you must substitute the actual names of your queries for Q1 ... I have assumed that employeeID in query 2 would never be NULL. ... > 2) - Training completed by Employee ... > multiple training modules, even the same modules across multiple years, ...
    (microsoft.public.access.queries)
  • RE: Query based on 3 tables with parameters from form
    ... I have created a fairly large database and up to this point all SQL ... statements and queries and form coding has been fairly simple. ... SELECT repair4b.*, DisciplineLinker.Discipline, AircraftExperience.Sector ... I have created a query with the employee table on the ...
    (microsoft.public.access.queries)
  • Re: Error trying to use form control value in query criteria
    ... you said you had queries with form criteria. ... To execute queries or use recordset in ADO would have to be done in VBA and never via the Access UI because it's DAO by default. ... I just tested with an ADO recordset using a form control reference and as expected, ...
    (microsoft.public.access.modulesdaovba)