Question

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?

Was it helpful?

Solution

Well they are totally different animals. MVC is all about presentation of data, controlling the navigation of the 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, dispatched then received), but these states are an integral part of the business logic and don't lend themselves to the session management typical of the MVC pattern.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top