|
<<<<<<<<<<<<<<<<<<<<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());
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|