Next

Back

Start

Also in the Domain Layer there are objects that image the relational database. There are three types of data objects.

•     Category and Item objects are the same as the menu records in the relational database.

•     An OrderItem object is a line item in the shopping cart. It is derived from an Item object. Its new fields are Quantity and ExtendedPrice. The Quantity field is live; that is, when a value is assigned to it, the ExtendedPrice value is automatically computed.

     Putting arithmetic in the Domain Layer this way greatly simplifies the Application layer, making it essentially algorithm-free.

In this demo I don't deal with making OrderItem objects persistent.