I am working on a 3 tier project and i am new to this.I have created some methods in DAL and can i call them directly into UI?? or i have to call the methods in the BAL and access it in UI?Can anyone please calarify this?
MY BAL
public class ProfileMasterBLL
{
public int UserId { get; set; }
public string FormFiledBy { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
The Three Tier means there will be three layers, It means that eery method will have three implementations.
UI Implementation
Business Logic Layer (BLL) Implementation
Data Access Logic (DAL)
If you Directly call DAL from UI then it will two tier architecture and not three.
If your DAL is table-centric, you can't validate all business rules in the DAL. Some rules are cross-table, cross-record rules, and table-oriented database code can't handle all such cases. That is why you have BAL to handle and validate such rules.
While UI will take care of design and requesting methods calls from BAL.
You need to go with 3 tire Architectural or Layered approach.
1. All Method calls from presentation will goes to business layers.
2. Business Layer is disigned for validation, configuration rules & other interop operation.
3. After doing this validations Methood Call goes to DAL which only communicates
to the Database / Datasources.
.net_junkie
Member
297 Points
825 Posts
Regarding 3 tier
Aug 13, 2012 05:24 AM|LINK
I am working on a 3 tier project and i am new to this.I have created some methods in DAL and can i call them directly into UI?? or i have to call the methods in the BAL and access it in UI?Can anyone please calarify this?
MY BAL
public class ProfileMasterBLL { public int UserId { get; set; } public string FormFiledBy { get; set; } public string FirstName { get; set; } public string LastName { get; set; } }In my UI
in my DAL
method for insert()
kunal.goel
Participant
988 Points
198 Posts
Re: Regarding 3 tier
Aug 13, 2012 05:46 AM|LINK
you should call the methods in the BAL and access BAL method in UI
Thanks and regards
Kunal Goel
.net_junkie
Member
297 Points
825 Posts
Re: Regarding 3 tier
Aug 13, 2012 05:56 AM|LINK
For every method i have to create a class in BAL or all the methods in single class??
Anoop Shakth...
Member
100 Points
42 Posts
Re: Regarding 3 tier
Aug 13, 2012 06:09 AM|LINK
You have to call for all the methods if it is necessary for u
shivanand G ...
Participant
1763 Points
534 Posts
Re: Regarding 3 tier
Aug 13, 2012 06:18 AM|LINK
refere this...
http://www.c-sharpcorner.com/uploadfile/paulabraham/building3tierapppa11282005053625am/building3tierapppa.aspx
http://www.aspdotnet-suresh.com/2010/05/introduction-to-3-tier-architecture-in_17.html
Good luck
shivanand.G.N (shivu.betta@gmail.com)
GaurangNaik
Contributor
2080 Points
497 Posts
Re: Regarding 3 tier
Aug 13, 2012 06:36 AM|LINK
Hi,
The Three Tier means there will be three layers, It means that eery method will have three implementations.
If you Directly call DAL from UI then it will two tier architecture and not three.
If your DAL is table-centric, you can't validate all business rules in the DAL. Some rules are cross-table, cross-record rules, and table-oriented database code can't handle all such cases. That is why you have BAL to handle and validate such rules. While UI will take care of design and requesting methods calls from BAL.
Hope this helps.
GauranG
Rajesh Sawan...
Participant
1612 Points
246 Posts
Re: Regarding 3 tier
Aug 13, 2012 06:46 AM|LINK
Hi,
You need to go with 3 tire Architectural or Layered approach.
1. All Method calls from presentation will goes to business layers.
2. Business Layer is disigned for validation, configuration rules & other interop operation.
3. After doing this validations Methood Call goes to DAL which only communicates
to the Database / Datasources.
-----|-----Presentation-Layer (UI)
---------|-----Business_Layer (Business Logic & Validations)
--------------|-----Data_Access_Layer---> (DB CALL & Data Manipulation)
Advantage is If we goes with above architecture then we can add any layer further &
rest of system remains un-touched as shown below.
-----|-----Presentation-Layer (UI)
---------|-----WCF Layer
---------|-----Windows_Service_Layer
---------|-----Business_Layer (Business Logic & Validations)
--------------|-----Data_Access_Layer---> (DB CALL & Data Manipulation)
For reference you can check :
http://www.codeproject.com/Articles/11128/3-tier-architecture-in-C
Please remember to mark the replies as answers if it helps
and unmark if it's not helpful.
3 tire web Architecture
//Happy Coding
Regards,
RajeshS.