none
can we design the architecture as mvc co-exist with SOA? RRS feed

  • Question

  • Can a web based application use the MVC design pattern with  service-oriented architecture as  a model?

    View

    Controller 

    Model ->  web  service client

    Business Logic - > Web service 

     

    is it a best practice?

    Monday, November 15, 2010 12:39 PM

Answers

  • I don't follow the question.

    What you seem to be asking is if SOA is a bad approach then how can do we do that bad approach.

    If it's a bad approach then we don't.

    If we do then there's rarely any point in two layers of services.  The exceptions being when you need to decouple two applications. 

    Many web apps are the only apps using their data/business layers.  The reasons one might make database access into a service would be:

    1)  to spread load - for n tier

    2) the app inherently needs services - silverlight.

    3) some third party is providing the services so they're already there - like google or Dynamics CRM.

    So if you have a good reason then you use services.

    Otherwise, you don't.

    There's no particular pattern around because MVC starts at the model and your service(s) will be what that model consumes.

    Tuesday, November 16, 2010 8:27 AM

All replies

  • You could well use services in or beneath the model layer.

    I can't see why you would have two lots of services like you seem to indicate.

    Anyhow there's the model running on your web server.

    If that's in the same room as the database server then I'd want some other reason for using a service.

    Maybe some other application is to share that data.

    If there's no other reason for introducing yet another layer and yet another complexity then there's zero justification and it'd be a bad approach.

    Monday, November 15, 2010 2:51 PM
  • If it's bad approach, how can we develop the web based application with SOA and MVC? 

    Is there any design patterns?

    Tuesday, November 16, 2010 5:22 AM
  • I don't follow the question.

    What you seem to be asking is if SOA is a bad approach then how can do we do that bad approach.

    If it's a bad approach then we don't.

    If we do then there's rarely any point in two layers of services.  The exceptions being when you need to decouple two applications. 

    Many web apps are the only apps using their data/business layers.  The reasons one might make database access into a service would be:

    1)  to spread load - for n tier

    2) the app inherently needs services - silverlight.

    3) some third party is providing the services so they're already there - like google or Dynamics CRM.

    So if you have a good reason then you use services.

    Otherwise, you don't.

    There's no particular pattern around because MVC starts at the model and your service(s) will be what that model consumes.

    Tuesday, November 16, 2010 8:27 AM