On Fri, Feb 15, 2008 at 09:19:51AM -0400, Michael Adonay wrote:
> All accounts have:
>  - name
>  - description
>  - creation date
> 
> Credit Cards have:
>  - credit limit
>  - cut date
>  - validity date
> 
> Checking Accounts have:
>  - also have a cut date
> 
> I have thought of some alternatives myself, which are:
> 1 - Creating a separate table for each type, which would be difficult to
> 'scale' from and also a bit difficult to track transactions (would be a mess
> at the time of making 'joins' etc..)
> 2 - Creating a single table for all (would make me a big bothersome table
> that has blank fields/columns taking up some beautiful space, and it wouldnt
> be as organized as the next alternative).
> 3 - Creating one table that holds the information that all accounts have,
> and one table that holds the specific information of each type.

   The firs way can be implemented in SQLObject using standard inheritance:

class Account(SQLObject):
   name = StringCol()

class CreditCard(Account):
   CreditLimit = IntCol()

   The third way can be implemented in SQLObject using special inheritance:
http://sqlobject.org/Inheritance.html
   But please be warned that the implementation of that inheritance is
rather limited (some limitations are documented at the page).

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to