Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Recent Topics
Advanced Search
UML - CLASSES DIAGRAM - A specific problem  
Forum Index -> UML Questions
Author Message
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.
 
leslie


Joined: 2006/06/08
Messages: 8

Offline

Common attributes should be assgned to the payment class - 'account number', 'amount', etc.

Les
 
Anonymous

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.

 
Anonymous

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.
 
Anonymous

Thanks for your help!
 
 
   Forum Index -> UML Questions
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil