revigniter - Model-View-Controller in Rev terms?

Ralf Bitter rabit at dimensionB.de
Sat May 15 17:06:59 EDT 2010


OK, one could compare a stack with a web application.

Then a view is what is presented to a user, something like
the layout of one card (page) of your stack, consisting of
all the visible components (images, forms, text, buttons etc.),
containing a minimal amount of code, if at all.

The controller in terms of Rev is your card script, which
holds code solely related to this specific card (page) and
serves as an intermediary between your libraries (models),
the controls on your card (page) and any other resources
(stack script etc.).

The model is the logic, responsible for inserting, updating and
retrieving data. This code, usable by all your cards (pages), resides
in a highly specialized stack (model) used as a library.

The goal of revIgniter's Model-View-Controller development pattern
is to separate application logic from presentation, to keep your
code as clean as possible ( you don't really want irev files
containig a wild mixture of HTML, CSS, JavaScript and revTalk) and
to apply reusable code (model) where appropriate. Though, the separation
added by models is not mandatory, instead revIgniter enables you to
work in a way that makes the most sense to you.


Best

Ralf



On 15.05.2010, at 21:13, Ian Wood wrote:

> I'm investigating Ralf's revIgniter framework (fantastic work, by the way), and start running into my 'narrow' experience of programming...
> 
> Model-View-Controller is a programming approach that is new to me. Separating presentation & data (as in most CMS-driven websites) is another matter.
> 
> A bit of help from Google & Wikipedia & I *think* I've got an idea how it works, but would like some reassurance/pointers from the list in translating concepts into what I know (Rev).
> 
> 
> MVC in Rev terms would be (roughly):
> 
> View is a Stack visible to the user (or audio etc.). Everything is presented through this to the user.
> 
> Controller takes input from the user (mouse-clicks, typing, keystrokes etc.) and does the major processing? e.g. Rev handlers that handle the bulk of the logic in an app?
> 
> Model would then be equivalent to all the 'utility' handlers and libraries?
> 
> 
> I'm aware that there may not be a one-to-one equivalency here, but is this along the right lines?
> 
> Thanks,
> 
> Ian




More information about the use-livecode mailing list