Java Reference
In-Depth Information
Figure 2-1. Order entry system object model
We will want to browse all orders as well as each individual order in our system. We will
also want to submit new orders and update existing ones. Finally, we will want to have the
ability to cancel and delete existing orders. The
OrderEntryService
object represents the
operations we want to perform on our
Order
,
Customer
,
LineItem
, and
Product
objects.
Model the URIs
The first thing we are going to do to create our distributed interface is define and name each
of the distributed endpoints in our system. In a RESTful system, endpoints are usually re-
ferred to as
resources
and are identified using a URI. URIs satisfy the addressability require-
ments of a RESTful service.
In our object model, we will be interacting with
Orders
,
Customers
, and
Products
. These
will be our main, top-level resources. We want to be able to obtain lists of each of these top-
level items and to interact with individual items.
LineItems
are aggregated within
Order
ob-
jects so they will not be a top-level resource. We could expose them as a subresource under
