OrderDetail Class

Design Pattern Framework 3.5

Design Pattern Framework 3.5 OrderDetail Class
Patterns-In-Action! ApplicationBusinessObjectsOrderDetail
Class that holds order details (line items) for an order.
Declaration Syntax
C# Visual Basic
public class OrderDetail : BusinessObject
Public Class OrderDetail _
	Inherits BusinessObject
Members
All Members Constructors Methods Properties



Icon Member Description
OrderDetail()()()
Default constructor for Order Detail.

OrderDetail(String, Int32, Single, Single, Order)
Overloaded constructor for Order Detail.

AddRule(BusinessRule)
Adds a business rule to the business object.
(Inherited from BusinessObject.)
Discount
Get or set discount applied to unit price.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Order
Get or set the Order of which this Order Detail is part of.

ProductName
Get or set Product name of Order Detail (line item).

Quantity
Get or set quantity of Products ordered.

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
UnitPrice
Get or set unit price of Product in US$.

Validate()()()
Determines whether business rules are valid or not. Creates a list of validation errors when appropriate.
(Inherited from BusinessObject.)
ValidationErrors
Gets list of validations errors.
(Inherited from BusinessObject.)
Version
Gets or sets version. Used in support of optimistic concurrency.

Remarks
Enterprise Design Pattern: Domain Model. This is where your business logic resides. In this example there are none. Another place for business logic and business rules is in the Facade. For an example see CustomerFacade in the Facade layer. The Domain Model Design Pattern states that domain objects incorporate both behavior and data. Behavior may include simple or complex business logic.
Inheritance Hierarchy
Object
BusinessObject
  OrderDetail

Assembly: BusinessObjects (Module: BusinessObjects) Version: 1.0.0.0 (1.0.0.0)