Sunday, November 20, 2011

Business Tier:

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.

Thursday, November 10, 2011

Data Access Tier:


Data Access Tier is a  class library consisting of set of classes used to encapsulate data access methods like CRUD (CREATE, READ, UPDATE, and DELETE) operations as well as a set of methods to communicate with data store.
Its primary job is to communicate with any data store like XML, RDBMS, or any Text file etc. It does not contain any business logic. It is used to help communicate with data store to fetch and store data.

This library contains a set of classes. The primary purpose of this library is to communicate with  database.This library does not implement any business logic. 

------------------------------------------------------------------
namespace IDAL

{
 public interface IBluePrintDAL
{
BluePrintInfonfo GetDALVal()
}
}

------------------------------------------------------------------

interface DAL
 {
public class BluePrintDAL : IBluePrintDAL
{
public BluePrintInfonfo GetDALVal()
        {
           Execute sp to get it
           
            return Bluevendor;
        }

}


------------------------------------------------------------------