Design 2 - Solving the problems of design 1 using Control Entities

To do away with the limitations of the first design, lets make some changes to this system and see whether we are able to take care of certain parameters.

Always remember, a design change should never change the customers requirements, Or keeping the customers requirements constant , we should be able to design the system in a way that most of the above mentioned parameters can be satisfied.

To solve the problems encountered in the previous design, I will simply add a level of indirection in this system called as Control entities, wherein for every behavior offered by the system, I will add a control entity, wherein the corresponding control entity will now encapsulate the business logic of the specific behavior.

Lets look into the following figure to study the modified design

Design 2 - Using control entities

Design 2 - Using control entities

The only difference is that in this figure we have encapsulated the business logic of each behavior in a separate control entity.

There is a one to one mapping between the number of functionalities exposed and the number of control entities. These control entities are also called as process entities or workflow modeling entities.

What are the control or process or workflow modeling entities?

A control entity is an entity the responsibility of which is to encapsulate the business logic of a behavior of the system.

So in the modified design we can see that for every behavior offered by the system, there is a corresponding control entity wherein every control entity will now have the business logic as to which all domain entities or structural components to manipulate so as to achieve the particular behavior.

Apart from having the business logic, every control entities will expose general interfaces like reserve(inp1,inp2,in3) :boolean which describes the name of the method along with the input parameters and the output result type.

So now in the new design we have the following control entities.

 

  • RCE holding the business logic for reservation along with its general interfaces.
  • CCE holding the business logic for Cancellation along with its general interfaces.
  • PreCE holding the business logic for Preponing along with its general interfaces.
  • PostCE holding the business logic for Postponing along with its general interfaces, etc.

 

 
Hemant Jha
Founder - VPlanSolutions
Researcher, Trainer

www.VPlanSolutions.co.in