Category Class

Design Pattern Framework 3.5

Design Pattern Framework 3.5 Category Class
Patterns-In-Action! ApplicationBusinessObjectsCategory
Class that holds information about a product category.
Declaration Syntax
C# Visual Basic
public class Category : BusinessObject
Public Class Category _
	Inherits BusinessObject
Members
All Members Constructors Methods Properties



Icon Member Description
Category()()()
Default constructor. Establishes simple business rules.

Category(Int32, String, String)
Overloaded constructor for Category class.

AddRule(BusinessRule)
Adds a business rule to the business object.
(Inherited from BusinessObject.)
CategoryId
Gets or sets unique category identifier. The Identity Field Design Pattern.

Description
Gets or sets the category description.

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.)
Name
Gets or sets the category name.

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
Version number. Used in optimistic concurrency decisions.

Remarks
Enterprise Design Pattern: Domain Model, Identity Field. 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. 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
  Category

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