Re: OOP - a question about database access
From: Tim (nocomment_at_rogers.com)
Date: 11/01/03
- Next message: JXStern: "Re: OO's best feature survey results"
- Previous message: Marc Gluch: "Business Interface pattern"
- In reply to: Doc O'Leary: "Re: OOP - a question about database access"
- Next in thread: Topmind: "Re: OOP - a question about database access"
- Reply: Topmind: "Re: OOP - a question about database access"
- Reply: Doc O'Leary: "Re: OOP - a question about database access"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 01 Nov 2003 15:28:33 GMT
Doc O'Leary wrote:
> In article
> <D8yob.132399$h61.112745@news01.bloor.is.net.cable.rogers.com>,
> Tim <nocomment@rogers.com> wrote:
>
>
>>If this is the wrong newsgroup, can someone please point me to the
>>correct one and disregard this.
>
>
> Right group, but that doesn't mean I'm going to be nice. :-)
>
>
>>The columns in the table are date, home team, visitor team and starting
>>time.
>>(I'm going to use Java in a JDeveloper environment and the database is
>>an MSAccess using a JDBC/ODBC bridge)
>
>
> This is the data model; almost nobody needs to care how objects persist.
> Your concern should be the object model, which you don't even hit on.
>
Well, that was the question. I think it should be obvious how the data
will be used and I wanted to know, given the simple example, how you
would set up the various objects to manipulate this simple table. In
this case, the table has been populated already and it was just an
access situation.
What type of objects are necessary and what are their basic functions
for database access?
>
>>So, how would you divide the various functions regarding interfaces,
>>inheritance, etc.
>
>
> Based on what they do and how they are used. You've failed to give any
> indication of how the system will be used, so no useful objects can even
> be guessed at, let alone how they might relate to one another.
>
>
>>Does the object that represents a game's information have the methods to
>>connect to the database, execute the query and retrieve the rows from
>>the resultset or are they done in the calling program or elsewhere?
>
>
> There is no "object that represents a game's information". There
> *might* be a Game object, but what it is depends on what the system will
> be doing.
Do you spend you whole life talking like this? What do you actually
think this data would be used for? Be creative!
The persistence of said object is controlled by the object,
> possibly by using a common mechanism/library for persistence.
>
>
>>Does
>>each column have it's own get method or do you pass all of the game's
>>info to the calling class by a container once retrieved?
>
>
> There are no columns in the object model. You need to stop thinking
> about the data. This is especially true for what you have, which sounds
> like a very flat data structure. That is, a "home team" is not the text
> that is in the column, but is likely best normalized as a referenced
> Team object.
>
>
>>Do you get all
>>rows of the result set from one call to the method of the object or do
>>you use a GetNextRow method and check a return code?
>
>
> No rows in the object model either. There might be a collection of
> objects you'll use, but how that mapping happens depends on the
> persistence mechanism. I've seen systems that load entire object trees
> and I've seen systems that delay access to the stored data until an
> object is actually used. What might be best for you depends entirely on
> the details you haven't given.
- Next message: JXStern: "Re: OO's best feature survey results"
- Previous message: Marc Gluch: "Business Interface pattern"
- In reply to: Doc O'Leary: "Re: OOP - a question about database access"
- Next in thread: Topmind: "Re: OOP - a question about database access"
- Reply: Topmind: "Re: OOP - a question about database access"
- Reply: Doc O'Leary: "Re: OOP - a question about database access"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|