home > Computers & Technology > Object Oriented Programming > About Business Objects and Domain

About Business Objects and Domain

As we know business objects are abstractions of the entities that are involved in a business process. When we need to find out the status of the object we call methods implemented with in it. Also if we need to modify the state of the object we usually call a method from the object to do it. So far every thing adheres to object oriented rules and laws.

Taking a close look at methods and behavior implemented within business objects. I found that there is a good deal of the business domain and rules built in the object. I think making the business object to be aware of such information is unnecessary and at the same time is defeating the propose of having a business domain implementation. What I think the business object must provide is a standard interface that would allow a user/process to read and modify the object's state. It must also include a set of methods that will allow the object to serialize itself to a memory representation that could be store on any device or transmitted to other places. This last property looks like a mutation of the object, but indeed it is. I think the business object must not have any knowledge about persistence, which I think is the job of who ever is using the object. I will explain bellow what I mean.

To make possible what I have said about business objects I have created a model that I would call "Business Process Environment".

A "Business Process Environment", is a level of abstraction such that it represents a "Business Process" in a business domain (think for a second in a C++ namespace for instance). This is the place where environment agents use business objects. An agent is the operational unit of the environment that would be able to operate over the object and do what ever is instructed to do with it. Let me give you an example.

For the "Trading Business Model" there would be an "Order Management Environment" in such a way that it will make its job by coordinating all the agents within the environment. The "Trader Agent" will be sole responsible for entering orders and execution. The "Book Agent", will be responsible for organize the orders into chapters and pages, the media it will utilize to store the objects can be any thing. A "Query Handler Agent" will be responsible from execute queries on container agents like the "Book Agent" and return the appropriate result and the "Rule Compliance Agent" will know every think about business rules.

With the model I propose the entry of an order will look like this:

User enters an order though GUI and press submit,

<<<<<<<<<<<<<<<<<<<<Scope of the Entry Form>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

COrderEntryForm::OnSubmit(...)

//Creates a tagged stream with the information for the order

//to be entered

m_tgOrderInfo = SerializeFields();

ENTER_BUSINESS_DOMAIN

{

//Creates an instance of the Business Object

m_pboOrder = (CBOOrder *) OrderFactory::Create(m_tgOrderInfo);

//Verifies order

Validate (m_pboOrder);

//Places order

Place(m_pboOrder);

}

ERROR_CATCH (All,Info)

{

switch(Info.Code)

{

case VIOLATED_RULE:

case INVALIDS_YMBOL

}

}

EXIT_BUSINESS_DOMAIN

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<<<<<<< Business Domain >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

void buisiness_domain:: Validate (CBOOrder & boOrder)

{

rule_compliance::Validate(boOrder);

}

void rule_compliance:: Validate (CBOOrder & boOrder)

{

// Inquiries the object and apply rules

try

{

WhoAreYou( boOrder)

CheckSecurity(boOrder)

catch(e,any)

{

ThrowBusinessDomainError(e);

}

}

void buisiness_domain:: Place (CBOOrder & boOrder)

{

//Here if the trader agent is on another machine the Agent Scope Manager will

//Ask the business Object to serialize itself to be transmitted.

trader_agent::Place(boOrder);

}

//Before the scope manager actually calls the Place function it will rebuild the business object

//based on the serialized information received. And the it will proceed with the application

void trader_agent:: Place (CBOOrder & boOrder)

{

//Here is not specified the mechanim to return confirmation of the transaction

book_agent:Put(boOrder);

}

void book_agent:: Put(CBOOrder & boOrder)

{

LocateCharpeter(boOrder.GetIdentity());

LocatePage(boOrder.GetIdentity());

Write(boOrder);

}

void book_agent:: Write(CBOOrder & boOrder)

{

LocateRow(boOrder);

Store(boOrder.GetIdentity(),boOrder.Serialize());

}

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

back to top


created by: dadasdesign

last update: Thursday, October 07, 2004

home | about myself | comp&technology | favorite sites