Historical association pattern

Viewed 67

I'm currently studying software engineering patterns and one that we've been given to study is the "historical association pattern" It refers to the historical mapping pattern given in Fowler's "Analysis patterns" book. The example we've been given is as follows:

enter image description here

I've tried looking for information online on how this structure would be implemented but I've found nothing regarding historical mapping associations. What would be a code/pseudo-code example of this structure?

1 Answers

Short answer

This pattern consist simply of using some dates for an association, by the means of an association class.

Full explanation

The diamond in the middle is a ternary association between Employee, Date and Money. The dotted line says that the Salary is the association class and it is also associated with a Date.

The association class would be typically be implemented with tuples/composed classes of Employee, Date, Money and the Salary attributes. The way it is done can be very different: in Java you’d directly refer to the associated objects, whereas in a db you’d have a mix of ids and salary attributes. Much simpler than this impressive diagram.

There are simpler models for that!

This diagram is difficult to read (ternary association), difficult to understand (multiplicity in ternary associations are not obvious to grasp), ambiguous (i.e. is Salary associated with two dates, from the ternary association it represents and from the direct association? or is it just a graphical redundancy?).

It would be much simpler to understand if it would be refactored into a binary association, and if value objects such as Dare would be shown as attributes.

Related