27.3. Time Intervals and Product Prices—Fixing an Iteration 1 “Error”

In the first iteration, SalesLineItems were associated with ProductSpecifications, that recorded the price of an item. This was a reasonable simplification for early iterations, but needs to be amended. It raises the interesting—and widely applicable—issue of time intervals associated with information, contracts, and the like.

If a SalesLineItem always retrieved the current price recorded in a ProductSpecification, then when the price was changed in the object, old sales would refer to new prices, which is incorrect. What is needed is a distinction between the historical price when the sale was made, and the current price.

Depending on the information requirements, there are ...

Get Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.