| Author |
Message |
|
2007/04/02 05:56
|
|
|
lmhelp
Joined: 2007/04/02
Messages: 1
Offline
|
|
|
|
Hello,
Thank you for reading me.
The diagram I have to draw is a classes diagram.
The situation is the following:
suppose there are only two ways in which one can pay for something somewhere:
- with a credit card (attributes: number and date),
- with a cheque (attribute: number).
Suppose there is one type of payment per bill.
Suppose there is a BILL class.
I was thinking about creating three classes:
- PAYMENT (no attributes),
- PAYMENT_BY_CREDIT_CARD (attributes: number, date),
- PAYMENT_BY_CHEQUE (attributes: number)
with PAYMENT_BY_CREDIT_CARD and PAYMENT_BY_CHEQUE
being sub-classes of PAYMENT.
I am a beginner, I sincerely don't know how to represent this situation, please help me.
Thanks a lot in advance.
|
|
|
|
 |
| |
|
2007/04/11 06:38
|
|
|
leslie
Joined: 2006/06/08
Messages: 8
Offline
|
|
|
|
Common attributes should be assgned to the payment class - 'account number', 'amount', etc.
Les
|
|
|
|
 |
| |
|
2007/04/11 15:43
|
|
|
|
|
Thanks Leslie for your answer.
A solution that was exposed to me makes of:
-> PAYMENT an abstract class,
-> and PAYMENT_BY_CREDIT_CARD and PAYMENT_BY_CHEQUE
two subclasses of the PAYMENT class.
For PAYMENT, in ArgoUML, a class was created with no attributes and a stereotype <<abstract>>.
For PAYMENT_BY_CREDIT_CARD was created a class with two attributes: number and date.
For PAYMENT_BY_CHEQUE was created a class with one attribute: number.
|
|
|
|
 |
| |
|
2007/04/15 01:17
|
|
|
|
|
|
You should consider using superclass of Payment with attributes od Date, Amount etc, and 2 subclasses of CredtCardPayment and ChequingAccountPayment with their own specific attributes that are not in the superclass.
|
|
|
|
 |
| |
|
2007/05/05 23:09
|
|
|
|
|
|
 |
| |