views:

1313

answers:

2

I think that business logic should exist in a model when using an MVC or MVP design pattern, but should be hidden behind a service in a service-oriented architecture.

Can a software system use the MVC or MVP design pattern within a service-oriented architecture? If so, where does the model sit?

+5  A: 

Well they are totally different animals. MVC is all about presentation of data, controlling the navigation of hte user dialog and some business logic in building the data model.

SOA is about retrieving data from a service provider.

On the client side you can use SOA within the Model part of the MVC pattern to build up your model with data from a SOA service.

On the service side as there is no presentation and no user dialog most of the MVC pattern becomes redundant. Furthermore good SOA design should concentrate on providing a useful service regardless of the underlying data store so the "model" part becomes largely incidental.

It is true that many services are "stateful" (e.g. orders are validated, paid for, despatched then received) but these states are an integral part of the business logic and dont lend themselves to the session management typical of the MVC pattern.

James Anderson
+1  A: 

Good Question. I think MVC and SOA will and must co-exist. MVC is the most sucessful architecture for User to system communication. SOA is an architecture for effective system-system communication. In most organisation, there is a place for both. Therefore I believe they will co-exist.

In terms of how they interact with each other, my personal opinion is - MVC will remain (once the SOA hype is gone) as the core architectural pattern with both model and controller exposing service interfaces where appropriate.

Jaywant