Order Class

Design Pattern Framework 3.5

Design Pattern Framework 3.5 Order Class
Patterns-In-Action! ApplicationBusinessObjectsOrder
Class that holds information about an order.
Declaration Syntax
C# Visual Basic
public class Order : BusinessObject
Public Class Order _
	Inherits BusinessObject
Members
All Members Constructors Methods Properties



Icon Member Description
Order()()()
Default constructor for order class.

Order(Int32, DateTime, DateTime, Single)
Overloaded constructor for the order class.

AddRule(BusinessRule)
Adds a business rule to the business object.
(Inherited from BusinessObject.)
Customer
Gets or sets the customer associated with the order. Enterprise Design Pattern: Foreign Key Mapping. Customer is the parent.

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.)
Freight
Gets or sets the freight (shipping) costs for this order.

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.)
OrderDate
Gets or sets the date at which the order is placed.

OrderDetails
Gets or sets a list of order details (line items) for the order.

OrderId
Gets or sets unique identifier for the order. Enterprise Design Pattern: Identity field pattern.

RequiredDate
Gets or sets the date at which delivery of the order is required.

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
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, Identity Field, Foreign Key Mapping. This is where your business logic resides. In this example there are none. Another place for business logic 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. The Identity Field Design Pattern saves the ID field in an object to maintain identity between an in-memory business object and that database rows. The Foreign Key Mapping Design Pattern is implemented by the Order to Customer reference. The pattern states that it maps an association between objects to a foreign key reference between table. The CustomerId is the foreign key to the Order.
Inheritance Hierarchy

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