MVC paradigm question
MVC paradigm question
- Subject: MVC paradigm question
- From: "Frederick C. Lee" <email@hidden>
- Date: Sun, 23 May 2004 10:51:17 -0700
I understand that the 'model' of MVC is designed to be independent of
the view and the 'controller' of MVC binds the View with the Model.
My question about the model:
1) Does (should) the model incorporate the data source as well?
2) Should the model be concerned with transforming the data-source
format into a different format to feed another object?
3) Or should a controller handle/transform the data from the data
source, whilst the model remains passive?
That is, should a model only represent the data but not actually
handle/extract its data?
I can see a blurry line between a controller and a model.
The scenario: a) multiple data sources that eventually combine into
one output; and b) a single view.
One data source (raw data) feeds into a product object that is loaded
into an object dictionary for storage. The user could reset the
finished output with the original raw data.
The multiple data source is actually: a) raw stock and b) finished
object (dictionary), {fed from the raw stock + user input} written to
disk.
-----
From what I've read, the model could be considered as the 'noun'; and
the controller as the 'verb'.
In which case, most of the work (getting & transforming the data) is
done in the controller; whereas the model simply represents the data
and hence, much simpler than the controller.
I'm tending toward the design of having a 'raw' controller that gets,
transforms & feeds the 'raw' model; the 'main' controller takes the raw
model/object and incorporates it into a product object; and writes the
product object (NSCoder compliant) to disk.
BTW: The 'raw' controller is actually a category of the main controller.
4) Is this the correct approach?
Thanks in advance.
Regards,
Ric.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.