Question

First I'd like to begin by illustrating the basic idea that I want to get done.

I'm designing a system by following the layered model view controller design. I essentially have a server and I would like to use tablets as the view/display. Now because I want to send data to and from the tablets through serialization, I can't figure out where to play the view controller classes for those tablets.

Ideally, when you'll boot up the tablet, you will have an option as to which view you wish the tablet to display (1 through whatever), but a view can't instantiate it's own controller I don't think.

So I just don't know where to have the view controller that technically creates the said views and how to allow it to communicate to said tablets. (This will be done in java/android)

Was it helpful?

Solution

MVC pattern is meant for one machine. So you can have the MVC pattern on your tablet. The controller here is kind of the glue code which instantiates the view and also creates the models (DAOs - Data Access Objects) to get data from the server.

This is all independent from what you will use on the server. You could say that on the server you also want to have something similar like MVC - in that case, the controller handles the REST, SOAP, ... - requests and instantiates a DAO which will retrieve the information from a file, database, ... The view afterwards could be seen as a serialiser which creates XML or JSON documents out of the fetched data.

What you might rather ask yourself, is if you want to have a Rich- or a Thin-Client. Rich-Clients have more independent logic, can maybe cache the data, ...; while Thin-Clients only display data and forward every performed action to the server.

OTHER TIPS

Actually I think you're mixing two different concepts which go well together but still, are different. The MVC pattern is a pattern for implementing user interfaces and is only used as an architectural pattern on very small project. On the other hand the layered architecture can be used server-side to implement a more complex application.

The two are often mixed because of the well-known 3-tier architecture (Presentation tier - Application tier - Data tier) on which analogy to the MVC pattern is easy (View = Presentation tier / Controller = Application tier / Model = Data tier) yet false.

About your problem specifically see zahorak's response about the thin/fat client choice you'll have to make.

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