Re: MVC paradigm question
Re: MVC paradigm question
- Subject: Re: MVC paradigm question
- From: eHolley <email@hidden>
- Date: Mon, 24 May 2004 15:58:31 -0600
1) Does (should) the model incorporate the data source as well?
In short, it can. Or, it doesn't have to. The MVC pattern has many
variations on the theme of separation of logic. Your particular flavor
may have much to do with your particular needs.
2) Should the model be concerned with transforming the data-source
format into a different format to feed another object?
Not necessarily. What you're describing is a separate MVC layer all its
own whose output becomes the model of another MVC structure.
3) Or should a controller handle/transform the data from the data
source, whilst the model remains passive?
Sometimes the controller is in fact wrapped up into the view class and
sometimes its completely separate. Its not wrong to implement the
pattern in the most straight-forward and simple way--in fact, its
better to do that than to bend your specific implementation around some
"rigid" pattern.
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.
4) Is this the correct approach?
Can be. Again, it all depends upon your particular needs. For instance,
think of Photoshop as having multiple layers of pixel data. Each layer
could be its own MVC structure. The bottom layer could represent what
is on disk and project its view of things to the next layer up as a
model for that layer... and so on until you hit the top. Maybe. Take a
look at what approach makes sense and is the simplest interface needed
to accomplish that task. That will usually be the "best approach."
-Erik
_______________________________________________
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.