This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I just read the Head First - Design patterns and aftrer the Compund Pattern chapter(on the MVC) some question just raise in to my head.
I design the URLyBird 1.3.3 and on the client side I manipulate data but I get this data(s) from the server side, responsable for the data "transport" is in my case the controller - he interacts whit the server, gets the information and packs it in to a model(or it changes the model).The model informs the view about the changesadn so on.
In the Head First - Design patterns on the Compound Patterns , MVC I found : *The controller implementes the behavior for the view *The model implements the application logic - the application logic is the code that manages and manipulates the data.
I think this can be true if I have only a pure MVC whitout a relation with an existing system.If you integrate your MVC in to a system then the controller is the "link" between your applicaion(MVC) and the rest of the system.Basic I have somethig like:
user -> view -> controller -> system
if the user interact with the view and :
system -> controller -> model -> view
if the system react(responds).The same logic I found in Max book.
I know that ther are many ways to implement (correct) the MVC pattern but is wrong to make the controller responsable for the "data" transport ? [ June 01, 2005: Message edited by: Mihai Radulescu ]
Hi, Darya, You are right thats what I try to say in the HFDP the (creamy) controller is communicating
with the view to change the display with the model to chage its state with the system/out side world(if you take a look at 529 the user/system does the "Paly the new song" action on controller)
BUT in HFDP the code that manages/manipulates the data is on the model. If you follow this logic for a if the client musts dispaly data from the server, its model must be able to "manipulates"/transports this information(and this is relativ simple if you hide all behind a proxy).
On Max book the controller "manipulates"/transports the data from server to the cleint(s )and them it builds the model (see the method find(String) VDTableModel from the gui package).
So if in HFDP the model "hides" the comunication between client and server on Max the server does this.
So what you think ? Whitch one is "better" ? [ June 01, 2005: Message edited by: Mihai Radulescu ]
Joined: Aug 21, 2004
I've seen people here who let the controller do the communication with the system to access the data from data file.
To my opinion it's better done from the model. Because the model is the data representation on the client side and hence has a tight relation to the database.
For me, the controller is simply delegating the view input to the model.