WCF service call in which layer?
-
I am writing a layered WPF application and want to call a WCF service. The method is below. I have Presentation - Business - Service and DataAccess layer. Can you please suggest which layer the below code should be written? Should it be in Business or Service layer? I am not sure even if there should be two different layers - Business and Service. What do you think?
public List GetUserList()
{
EmpSrv.Client EmployeeSrvc = new EmpSrv.Client;List lstEmployee = new List
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates -
I am writing a layered WPF application and want to call a WCF service. The method is below. I have Presentation - Business - Service and DataAccess layer. Can you please suggest which layer the below code should be written? Should it be in Business or Service layer? I am not sure even if there should be two different layers - Business and Service. What do you think?
public List GetUserList()
{
EmpSrv.Client EmployeeSrvc = new EmpSrv.Client;List lstEmployee = new List
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --SocratesTake a look at MVVM structures, they are very similar to your but if you use MVVM there is a lot of support and examples. Presentation = View Business = ViewModel Service = WCF (has the model) DAL = DAL (between the WCF and the database)
Never underestimate the power of human stupidity RAH
-
Take a look at MVVM structures, they are very similar to your but if you use MVVM there is a lot of support and examples. Presentation = View Business = ViewModel Service = WCF (has the model) DAL = DAL (between the WCF and the database)
Never underestimate the power of human stupidity RAH
Thanks! I have started looking at MVVM.
------------------------------------------------------------ "The only true wisdom is in knowing you know nothing." --Socrates
-
I am writing a layered WPF application and want to call a WCF service. The method is below. I have Presentation - Business - Service and DataAccess layer. Can you please suggest which layer the below code should be written? Should it be in Business or Service layer? I am not sure even if there should be two different layers - Business and Service. What do you think?
public List GetUserList()
{
EmpSrv.Client EmployeeSrvc = new EmpSrv.Client;List lstEmployee = new List
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --SocratesDotNetXenon wrote:
Should it be in Business or Service layer?
It depends on what this code is doing. It appears that this would go in the business layer. If it is just populating a list of Employees (without doing any business layer stuff) then it could even be in the presentation layer.
Too much of heaven can bring you underground Heaven can always turn around Too much of heaven, our life is all hell bound Heaven, the kill that makes no sound