Defining a domain model

Let's study this with an example. Suppose you are implementing a simple e-commerce application. You are in charge of the orders module, and have to provide access to the data related to this module through a web UI. After reading the specification, you designed a simple domain model formed by the following classes:

 

This is pretty straightforward: an Order has one or more Product objects and one Customer. You want to use the hypothetical Technology X to persist data (it doesn't matter which one for this example), and you want your Vaadin UI implementation to be able to directly use the domain class; however, you don't want to couple your UI implementation with Technology X. Moreover, you have to expose orders and product data through a web service for an external accounting system. You decided, then, to implement three repositories, one for each domain class: ProductRepository, OrderRepository, and CustomerRepository.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset