Just to clarify - a tier is a physical separation and a layer is a logical separation. Largely, when people talk about tiers in this forum, they mean layers. I assumed that you meant layers too, although your subsequent questions suggest my assumption was
wrong.
In terms of a typical structure, you usually see the following layers:
Data Store (eg database, XML, files)
Data Access (Code that coomunicates with the data store)
Business Logic (Code that co-ordinates between Data Access and Business Objects)
Business Objects (Code that represents the "model" or entities )
Presentation (UI, Views or whatever you want to call them)
If you want to wrap the business objects and business logic layer into a super-layer or tier and call it "middle tier" that is fine. There are no hard and fast rules.
moshik.salem
Member
34 Points
124 Posts
3-tier architecture question
Jun 15, 2012 07:27 AM|LINK
Hi,
1. If i want to build a 3-tier architecture, do i need to build a wcf communication layer for each tier so the tiers will be able to
communicate with each other?
--------------------------------------------------------------------------------------------------------------------------------------------------
regarding to the business tier, i understand that this tier should contian 2 layer, one as Business Logic layer and the other is
the Data Access layer my questions are:
2. should i build two wcf communication layers? one for the Business Logic layer to communicate with the Presentation tier,
and one for the Data Access layer to communicate with the Data tier? is that right?
3. if i have a Data tier which holds my data using a Database, how can i manipulate the DataBase to use the data it holds,
if the code which suppose to do the manipulating like the insert, select and so on, is found on the Data Acces Layer
in the Business Tier?
Thank you.
Mikesdotnett...
All-Star
155593 Points
19979 Posts
Moderator
MVP
Re: 3-tier architecture question
Jun 15, 2012 07:39 AM|LINK
No. One of the tiers will be data access. WCF is one option when it comes to writing a data access layer.
No - they are separate.
The database itself is not a layer. The Data tier consists of code to get data into and out of your database.
Read this for an understanding of how to construct an n-tier/layer system: http://imar.spaanjaars.com/416/building-layered-web-applications-with-microsoft-aspnet-20-part-1
It's for ASP.NET 2.0 but the principals are all still valid.
Web Pages CMS | My Site | Twitter
moshik.salem
Member
34 Points
124 Posts
Re: 3-tier architecture question
Jun 15, 2012 12:56 PM|LINK
I read the article, and have a few more questions:
1. So the Data tier will contain the Database and the Data Access Layer, so it can access the data on DataBase and pass it next
to the Middle tier? is that right?
2. The Business tier i.e the Middle tier, will contain the Business Logic layer and the Business Object Layer?
(regarding to what i wrote earlier i understand that the Data Access Layer should not be on the Business tier but on the Data tier?)
am i right?
3. How the 3 tiers will communicate each other with the next, assuming that each tier is seperated physically by hardware?
one option is wcf? am i right? and what other options do i have for this problem?
Thank you.
Mikesdotnett...
All-Star
155593 Points
19979 Posts
Moderator
MVP
Re: 3-tier architecture question
Jun 15, 2012 02:19 PM|LINK
Just to clarify - a tier is a physical separation and a layer is a logical separation. Largely, when people talk about tiers in this forum, they mean layers. I assumed that you meant layers too, although your subsequent questions suggest my assumption was wrong.
In terms of a typical structure, you usually see the following layers:
Data Store (eg database, XML, files)
Data Access (Code that coomunicates with the data store)
Business Logic (Code that co-ordinates between Data Access and Business Objects)
Business Objects (Code that represents the "model" or entities )
Presentation (UI, Views or whatever you want to call them)
If you want to wrap the business objects and business logic layer into a super-layer or tier and call it "middle tier" that is fine. There are no hard and fast rules.
More advice can be found here http://msdn.microsoft.com/en-us/library/ee658118.aspx on messaging between layers/tiers.
Web Pages CMS | My Site | Twitter