Added asynchronous event emission whenever a handling event is registered, so that interested parties can be notified if a cargo is misdirected (is unloaded, is late, has arrived, or whatever).
Two different implementations a available: JMS and a simple thread-based one.
Also, the cargo service track method now uses TrackingId in the signature, for consistency.
Entities have the method sameValueAs(otherEntity)
Value Objects have the method sameIdentiyAs(otherValueObject)
Events have the method sameEventAs(otherEvent)
Suggestion for handling domain validation as close to each domain object as possible - Location now requires UN locode argument to constructor to match a certain regexp, and each HandlingEvent.Type may answer type.requiresCarrierMovement() and type.prohibitsCarrierMovement(), evaluated from HandlingEvent constructor.
Replaced ellipsis argument in DeliveryHistory.addEvents() with two methods; one that takes a single HandlingEvent and one that takes a Collection<HandlingEvent>
HandlingEventService now has a single, strongly typed method for registering events.
A JAX-WS-based remote interface for registering events has been introduced, which works as an anti-corruption layer as well.
CarrierMovementRepository uses Hibernate implementation, test class created.
Reverted to Spring 2.0.8 in order to get JAX-WS integration going, but that's only until the next release gets out.
Made Cargo-HandlingEvent relation bidirectional again, with DeliveryHistory in the middle.
Restored Cargo.lastKnownLocation() and Cargo.hasArrived().
All entities have sequential identifiers with no domain meaning. Equals and hashcode rely on business logic unrelated to persistence state.
Removed findDeliveryHistory from HaEvRepo since it's now OR-mapped.
Improved javadoc.
- Persistent implementations of all repositories are in place, with tests and sample data generation.
Sample data is shared between testing and web application, and is loaded through a ServletContextListener
- No relation Cargo -> HandlingEvent, it only goes the other way. A HandlingEvent is only associated to one Cargo.
- TrackingId and CarrierMovementId do not rely on toString() anymore, the accessor for the id string is now called idString().
- CarrierId is now CarrierMovementId
- HandlingEventService now has named methods for registerLoad(), registerUnload() etc instead of the String "type" argument, which was extremely fragile.