Design Pattern Framework 3.5
Customer Class
Patterns-In-Action! Application ► BusinessObjects ► Customer
Class that holds information about a customer.
Declaration Syntax
C# | Visual Basic |
public class Customer : BusinessObject
Public Class Customer _ Inherits BusinessObject
Members
All Members | Constructors | Methods | Properties | ||
|
|
|
Icon | Member | Description |
---|---|---|
Customer()()() |
Default constructor for customer class.
Initializes automatic properties.
|
|
Customer(Int32, String, String, String) |
Overloaded constructor for the Customer class.
|
|
AddRule(BusinessRule) |
Adds a business rule to the business object.
(Inherited from BusinessObject.) |
|
City |
Gets or sets the customer city.
|
|
Company |
Gets or sets the customer name.
|
|
Country |
Gets or sets the customer country.
|
|
CustomerId |
Gets or sets unique customer identifier.
The Identity Field Design Pattern.
|
|
Equals(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.) |
|
LastOrderDate |
Gets or sets the last date the customer placed an order.
|
|
MemberwiseClone()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
|
NumOrders |
Gets or sets the total number of orders placed by the customer.
|
|
Orders |
Gets or sets a list of all orders placed by the customer.
|
|
ToString()()() | (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 the version number. Used for optimistic concurrency.
|
Remarks
Enterprise Design Pattern: Domain Model, Identity Field.
This is also the place where business rules are established.
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.
Inheritance Hierarchy
Object | ||
BusinessObject | ||
Customer |