What goes in a superclass?

From: Neil Burnett <neil_at_efc.be>
Date: 2000/05/20
Message-ID: <3926392D.88819059_at_efc.be>#1/1


Hi!

I am tacking on a bit of accounting to my contacts database (rdbms) to handle conference registrations.

I have a superclass called Transactions, with sub classes called CreditCardTransations, Cash, BankTransfers, and Cheques (no-one pays in bottle tops or Pokemon cards yet :-).

(We do a manual Credit Card charge with the Credit Card companies, so it
takes time)

Transactions: TransactionID, DateInput
CreditCardTransactions: TransactionID, CreditCardID, DateSubmitted, DateApproved, DateRejected, Amount
Cash: TransactionID, Amount
BankTransfers: TransactionID, Reference, DateOfTransfer, Amount Cheques: TransactionID, ChequeNumber, DateSubmitted, DateCleared, Amount

The main question I want to ask is should I move the Amount attribute of each class into the transaction superclass?

The secondary question is will it work? I.e. when I come to create the user interface, will the above design be the easiest to implement?

I have purposely left out a transaction type attribute (e.g. cash, credit card...) from the Transactions class as I think it might cause more trouble than its worth - but I am guessing. Besides, I have a
(possibly irrational) aversion to putting meta data into my database.

Regards

Neil Received on Sat May 20 2000 - 00:00:00 CEST

Original text of this message