Click here to Skip to main content
15,567,221 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
This question ask me interview.

1.Can we develop 3 different layers(Presentation layer,Business Layer and Data Access Layer) on separate server / machine ?

2.then How to import one of above layer into another layer of 3 tire architecture ?
If yes,then How can we access it ?

for example if i develop DataAccessLayer on separate server then how can we use this layer into Presentation layer which is already developed on different server/machine ?
Posted

  1. Yes, you can
  2. This question makes no sense. It is not defined what is "import"; this term is incorrect. Layers do not have "import" relationships.


However, the question in your last clause does make sense. The answer depends on the technology used in implementation of the Data Access Layer. Very typically, it can be implemented as some kind of Web Service (especially in relation to architectures related to ASP.NET mentioned as a tag to your question), in wide sense of this word. Then the other layer (presumably BL, not directly Presentation Layer) could communicate with this Service acting as its client. Please see:
http://en.wikipedia.org/wiki/Web_service[^],
http://en.wikipedia.org/wiki/List_of_web_service_specifications[^],
http://msdn.microsoft.com/en-us/library/t745kdsh%28v=vs.90%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms972326.aspx[^],
http://quickstarts.asp.net/QuickStartv20/webservices/default.aspx[^],
http://msdn.microsoft.com/en-us/library/hh156544%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms951274.aspx[^],
http://msdn.microsoft.com/en-us/library/ms730214%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 
v2
Your questions were answered here:
N-Tier Architecture and Tips[^]
 
Share this answer
 
Could be done if the meaning of layers is as fallow.

1.The database layer should contain only the databases tables, stored procedures and triggers and no other access code, and in this case can be put on DB server (1st machine);

2. Your business logic layer will access the DB layer, and I suggest to use Entity Framework for doing that, and will contains also the implementation of your application business logic. The access to the data access layer will be done by using DB connection string and Entity Framework. This 2nd layer could be installed on the 2nd server and should provide to the UI layer its functionality by implementing a Web Service or a Windows Communication Foundation (shortly WCF and this is my suggestion to use!) service.

3.The 3rd layer should be UI layer and this will access the Web Service or the WCF service from the 2nd layer.

NOTE: The direct access from 3rd layer (UI) to the 1st layer (Data Access) is forbidden and should be done indirectly by using 2nd 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