Business tier is a class library with set of classes that are converted into DLL and added as reference in the actual application. It presents data to the higher layers like UI and talks to the Data Access Layer to fetch data. Usually it performs the following tasks:
Fetch data from Data Access Layer on which it applies business rules.
Save data after applying rules on it.
Perform validation on data which has to be present or save.
This library should contain a set of classes to communicate with Data Access Layer. It should act as a mediator between Presentation Layer and Data Access Layer. Presentation layer communicates with Data Access Layer through this layer and domain objects are used to pass data between layers.Domain objects will be explained latter.
All the business logic required for the application hasto be defined in this library. For example Vendor related logic in VendorManager class, Product related logic in ProductManager class and so on. All these business classes have to be derived from the interfaces defined IBusiness library.
Now lets see the manager class BluePrintManager: this is the business class inherited from IBluePrintManager
-----------------------------------------------------------------------
namespace IManager
{
public interface I IBluePrintManager
{
BluePrintInfonfo GetManagerVal();
}
}
-----------------------------------------------------------------------
namespace Manager
{
public class BluePrintManager : IBluePrintManager
{
IBluePrintDAL blueDal = new BluePrintDAL();
public BluePrintrInfo GetManagerVal()
{
return blueDal.GetDALVal();
}
}
}
-----------------------------------------------------------------------
You can see something called BluePrintrInfo. This is used to pass data among layers.To know more about this please visit domain objects. BluePrintDAL is Data Access Layer and it is explained in next session.
namespace Manager
{
public class BluePrintManager : IBluePrintManager
{
IBluePrintDAL blueDal = new BluePrintDAL();
public BluePrintrInfo GetManagerVal()
{
return blueDal.GetDALVal();
}
}
}
-----------------------------------------------------------------------
You can see something called BluePrintrInfo. This is used to pass data among layers.To know more about this please visit domain objects. BluePrintDAL is Data Access Layer and it is explained in next session.