Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
example for implement three tier architecture as a dll
Posted
Comments
jim lahey 15-Sep-11 5:37am    
as a single .dll? as three separate .dlls for each tier? you need to provide a lot more information.
rkthiyagarajan 15-Sep-11 5:47am    
Dear Member 5833550, You ask this Question so many times.
R. Giskard Reventlov 15-Sep-11 5:53am    
Fairy cake flange bi-valve
Smithers-Jones 15-Sep-11 6:14am    
Not a question. You are a Lazy bum (TM). Reported. Oh, and also repost.

you should create separate projects for BAL, DAL (as Class Library) and UI (as Web project) and reference your BAL(DLL) into UI

http://www.dotnetfunda.com/articles/article71.aspx[^]
 
Share this answer
 
Here's an example. Put one or more of your tier components into a class library.
 
Share this answer
 
Hi,

Three tier means levels exists in between client and server right.
you are asking three logical layer architecture right letme explain you

frst you've to create dlls for each and every logic

I gave you steps to create dll now

create project->create class->write required code in that class->build project.

thats it your wrk is done here to creation of dll

thn import that dll into your project use that class methods by creating object for that class

this is the process of creating dll .

now we go some dipper in subject three tier means we divide working tasks into several dlls.

for e.g:
we divide database functions into one dll like insert,select,update,openconnection to database all these functionalities are write under one dll we call that dll as DBFunctions

same as business logic we develop dlls for each and every business functions
now we see how they communicate between layers

presentation layer(PL)->busines logic layer(BLL)->data Access Layer(DAL)

we maintain single DAL for database.we generalize all insertion statements for all tables we just call one method to insert data into data tables .

the DBfunction class contains following methods


C#
//method can be used for executing insert,delete,update sql commands
  public bool exenonquerycmds(string query)
{
    bool exestatus;
    sqlcommand cmd=new sqlcommand(query,con);
    int re=cmd.executenonquery();
   if(re>0)
   {
     exestatus=true;
   }
   else
    {
    exestatus=false;
   }
   return exestatus;
  
}

//method can be used for retrieving data from table
public datatable gettabledata(string query)
{
    Datatable dt=new Datatable();
    sqldatadapter da=new SqlDataAdapter(query,con);
    da.Fill(dt);
    return dt;
}

Like this we write all methods regarding business functions in BLL

we call those methods in PL to implement Three tier Layer
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900