Saturday, May 06, 2006

Pattern for resolving Association classes many - many relationship

On Thursday, i had one of the most satisfying coding expereinces since i started working. Not many people have heard of IAA , but i tell you it is becoming the de-facto standard for Architecting the Insurance Applications.
My designer gave me the class diagram and sequence diagram for implementing a particular part of Payment use case. There was a situation where we had a many to many assosciation relationship between two classes Payment and PaymentDue. These two classes are derived from an abstract base class called FinancialTransaction.
Now we had to establish the relationship between each payment made again a particular paymentdue. Thus a paymentdue can have multiple payments associated with it and also a payment can have multiple payments associated with it in case of Direct Debit transactions. So in orderto uniquely identify each payments association with a paymentdue, i created a link entity called financial transaction relationship and represented it as a class with attributes as amount and settlement date. In financial transaction class i had two lists as attributes of type financial transaction relationship called relatedTpFinancialTransaction and relatedFrom FinancialTransaction. Thus i was able to attach each unique payment against its corresponding paymentdue and vice versa.

No comments:

Post a Comment