Java Reference
In-Depth Information
<<interface>>
PlaceOrderService
updateDeliveryInfo(pendingOrderId, Address, Date)
PlaceOrder
ServiceTests
testUpdateDeliveryInfo_good()
...
PlaceOrderServiceImpl
updateDeliveryInfo(pendingOrderId, Address, Date)
PendingOrderTests
testUpdateDeliveryInfo_good()
...
PendingOrder
<< interface >>
PendingOrderRepository
updateDeliveryInfo(RestaurantRepository, Address, Date)
findOrCreatePendingOrder (pendingOrderId)
<< interface >>
RestaurantRepository
isRestaurantAvailable(Address,Date)
findAvailableRestaurants(Address, Date)
Figure 3.4
The domain model types and methods that we have developed so far
3.4 Summary
The Domain Model pattern organizes the business logic as a domain model,
which is an object model of the application's problem domain. The domain
model classes are invoked by either directly by the presentation tier or indirectly
via a POJO façade or a session façade. Each request handled by the presentation
tier typically results in one or more calls to domain model objects. The domain
objects validate user input, perform calculations, and access the database.
This pattern has all the benefits of the OO paradigm. For example, the busi-
ness logic is easier to maintain because responsibilities are distributed among the
classes of the object model rather than being concentrated in a few large classes.
It is also easier to extend because the domain model can use Gang of Four pat-
terns, such as the Strategy and Template Method patterns. The Domain Model
pattern is typically the best way to design complex business logic.
 
Search WWH ::




Custom Search