Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WCF service call in which layer?

WCF service call in which layer?

Scheduled Pinned Locked Moved WPF
csharpwpfwcfbusinessquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DotNetXenon
    wrote on last edited by
    #1

    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

    M A 2 Replies Last reply
    0
    • D DotNetXenon

      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

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      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

      D 1 Reply Last reply
      0
      • M Mycroft Holmes

        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

        D Offline
        D Offline
        DotNetXenon
        wrote on last edited by
        #3

        Thanks! I have started looking at MVVM.

        ------------------------------------------------------------ "The only true wisdom is in knowing you know nothing." --Socrates

        1 Reply Last reply
        0
        • D DotNetXenon

          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

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          DotNetXenon 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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups