Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping UML to VB 6

Status
Not open for further replies.

grimmersnee

Programmer
Nov 7, 2002
2
NZ
I have a problem. I have a member class that I want to have a relationship with a Payment class. One member can make many payments. I think this is called a one to many association. Anyway how would I go about translating it to vb code?

Your help would be greatly appreciated!!
 
Have a array declared in the Member Class of datatype Payment.. so u can have many payments in the member class..

Eg.,

Public Class Member
Public Name as string
Public PaymentDetails() as Payments
'Your Code to Add Paymentsdetails, etc., here
End Class

Public Class Payments
Public AccountNumber as string
Public Amount as currency
'YOur code to add amounts, etc.,
End Class
 
...or use a Collection/Dictionary object to hold the "many" items if
(a) Sequence is not important
(b) There aren't too many (say < 1000)

 
You could tie this more closely to the original UML, assuming that Member instantiates Payment, by making the Payment class PublicNotCreateable and putting a method in the Member class that creates a Payment object. This sets up the Paymet class as a dependent class to the Member class. Of course, you can't directly represent this type show this type of relationship in the association, since it isn't quite an aggregate or composite relationship, but using the <<instantiates>> stereotype will let you do that.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top