locked
Service Layer (WCF) Really Needed RRS feed

  • Question

  • User-574293449 posted

    Hi,

      I have an asp.net application which is using jquery in the webforms. So i used WCF REST to communicate between presentation and Data Layer. I din'y use entity framework. Now the applciation is going to migrate MVC. Here i have a debate with my new TL.

    He is telling there is no need Service Layer. In the controller directly access db with Entity framework. But i am thinking how the communicattion work. In MVC i can understand, in the controller methods we can convert to json and vice versa so no need to pass to the server as json. So may be entity framework put in the contoller can communicate with db.

     But i am hearing always with MVC and webapi only. So please suggst me which is the preferred way. If avoid WebApi what are disadavatages we have. Or like he told i can use simply EF in the controller or something to access db.

    I can tell one problem like the product supports mobile in the future so implementing webapi make it easier like access method from the service. Or this is also possible without webapi. Please guide me

    Wednesday, June 11, 2014 9:32 PM

Answers

  • User71929859 posted

    He is telling there is no need Service Layer. In the controller directly access db with Entity framework.

    product supports mobile in the future

    If you are going to develop native mobile apps, you must definitely have a service layer in order to consume those from native mobile apps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 14, 2014 3:12 AM
  • User-576912550 posted

    It varies from application to application. As Ruchira mentioned that to access from native mobile app, you require service layer. Another scenario could be if your application exposes public API, then also it is recommended that you build it on top of service layer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 16, 2014 2:33 AM
  • User25800215 posted

    HI,

    It is good idea to build service layer when it is being used by multiple applications (In your scenario it will desktop application, mobile app).

    But if your target is only for desktop kind of application and data does not required to share to any other department with in the organization or public) it is not suggested to use service layer unless security concerns. it is over head to use service layer unless certain need over the architecture.

    for your requirement, as application targetting to use multiple platform service can be used.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 18, 2014 5:10 AM

All replies

  • User71929859 posted

    He is telling there is no need Service Layer. In the controller directly access db with Entity framework.

    product supports mobile in the future

    If you are going to develop native mobile apps, you must definitely have a service layer in order to consume those from native mobile apps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 14, 2014 3:12 AM
  • User-576912550 posted

    It varies from application to application. As Ruchira mentioned that to access from native mobile app, you require service layer. Another scenario could be if your application exposes public API, then also it is recommended that you build it on top of service layer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 16, 2014 2:33 AM
  • User25800215 posted

    HI,

    It is good idea to build service layer when it is being used by multiple applications (In your scenario it will desktop application, mobile app).

    But if your target is only for desktop kind of application and data does not required to share to any other department with in the organization or public) it is not suggested to use service layer unless security concerns. it is over head to use service layer unless certain need over the architecture.

    for your requirement, as application targetting to use multiple platform service can be used.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 18, 2014 5:10 AM