Re: Beginner Question - Application Design

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




http://sholliday.spaces.live.com/blog/

6/5/2006
Custom Objects and Tiered Development II // 2.0

will get you started.





"---" <ident.online@xxxxxxxxx> wrote in message
news:1172607478.630003.247440@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm writing up a sample program to teach someone the basics of
database application design. I'm using the 2.0 framework and
Microsofts default "pubs" database.
What I'd like to do is create a simple app that connects to the
database and allows browsing, editing, creation and deletion of books
and authors. I'd like to show a good application architecture, with
clear seperation of data access, business logic (simple as it is), and
presentation. The student has basically been hacking his way around
application development for a while now, but has no real idea of
design.
My class design is basically as follows, but I have a few questions.

Book - Contains only book information, knows nothing about the
database. Relates 1 to 1 with the "titles" table
Author - Basically same as Book, 1 to 1 with the "author" table

Book_Record - Inherits from Book, but adds logic needed to locate,
load, and save itself to the database given a database interface
Author_Record - Basically same as Book_Record, but for authors

Books_Interface - This class has a bunch of static methods for saving,
locating, and retreiving Books from the database. It's initialized
with database interface information during the startup of the
application and passes this information to the Book_Records to allow
them to load and save themselves.
Authors_Interface - Basically same as Books_Interface, but for authors

GUI Stuff - The GUI basically calls the *_Interfaces to retreive the
objects (Books and Authors) for display and editing and passes them
back to the *_Interfaces for saving.

Now, here's the problems and questions:
All Books have Authors, and all Authors have Books, but where should
the linking be done? It would make sense fot the Books class to have
a getAuthors() methods (or Authors property), but that seems like it
would start to clutter things up (as well as start pulling alot of
things into memory). Books themselves have no knowledge of the
database, or even the Books_Interface or Authors_Interface. To me,
that seems like it's outside of their scope. How then, do we link the
two? I'd thought of adding methods to the Books_Interface such as
getBooks_For_Author(string author_id), addBook_To_Author(string
author_id, string book_id), etc. as well as similar methods to the
Authors_Interface (getAuthors_For_Book(...)...)

Anyone have any suggestions on a clean object model?



.



Relevant Pages

  • Re: Database Design & Normalization Question
    ... understand the logic behind the books, videos, software, ... didn't have to change the database design to store new ...
    (microsoft.public.sqlserver.server)
  • Re: MVC design questions
    ... Instead of a single CRUD GUI program I've got two, the idea being that one can be given to anybody because it can't damage the database (no insert/update/ delete capability at all while the other, which can do these things, is intended only for suitable authorised users: most data is bulk loaded and the update GUI is only there for removing to odd piece of junk and tidying up. ... In fact, i'd create three - a full-access account for the DBA, an account with the ability to edit the data, but not do DDL, for the update app, and a read-only one for the search app. ... I have almost no OO background and have no idea who the currently recognised OO design gurus are. ... That era was dominated by big ideas - big processes, big notations, big books, big words. ...
    (comp.lang.java.programmer)
  • Re: Database design
    ... On my single table database I have 28 categories and ... Jason's design is much preferable. ... Contacts who qualify for SAY; ... I have three books that cost me over $500 and none cover this topic! ...
    (microsoft.public.access.tablesdbdesign)
  • Beginner Question - Application Design
    ... database application design. ... Microsofts default "pubs" database. ... and save itself to the database given a database interface ... and retreiving Books from the database. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: I want to learn access
    ... up the database properly. ... > CDs that assume that you know how to design forms, tables, etc, which I ... All the books that I have seen on ... I am even ready to preapre applications for people ...
    (microsoft.public.access.gettingstarted)