Re: revigniter - Model-View-Controller in Rev terms?
Hi Ralf - I'm going to take a second look at revIgnitor - and pretty much agree with the entire approach and the mapping of MVC concepts to Rev. I am looking forward to integrating my code into your framework :) This is how I see the mapping: *View* Yes the visual appearance of the interface that lays out the data on screen ready for interaction. But specifically it includes any presentation logic such as code for resizing the view, or changing it's visual appearance. Also in general I feel that views map to groups with behaviors - therefore the Datagrid is a view. you should be able to drag and drop views onto cards and ideally nest them within each other, and to do this in a way which is completely independent of your particular applications logic and data. These views usually have custom properties that allow you to get and set their data in a standard way and also to change their appearance - a test of their MVC'ness is the ability to move them around and use them as is without editing their code in any way. I have found it very useful to test out views precisely this way by keeping them in an external library and testing the ability to drag and drop them into a variety of situations (manually or under script control). It would be possible to consider some cards or even stacks as views - so far I don;t do that - but it is possible for instance to automatically create stacks as dialogues which contain group views - so for instance I use the standard video, image, xml, and tree views to display data in a window using a command such as display_Image someUrl which creates a new stack, and copies the image view to that stack. It's a side effect of creating a good view that you also create some good dialogue stacks. *Models* I've not done that much on these and intend to use Trevors sqlYoga, and / or the work that Ralf has done. The important bit for me is the ability to move from arrays to databases - so I have an abstraction layer that uses arrays, but can easily be switched to XML or a database. *Controllers* The glue. I agree with Ralf that the best place usually for this code is the card script. And in simple terms it does everything else required to glue the views to the data. It is where the code that really defines the logic of your application is. I have a way of creating this code which automatically creates a basic interface - so this is often where I start coding -dragging a few basic views onto screen to display the data, and gradually defining the model. At the end I create new custom views for the application - perhaps by cloning one of the existing ones and if it is useful adding it to the library. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
revigniter - Model-View-Controller in Rev terms?
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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: revigniter - Model-View-Controller in Rev terms?
I haven't tried revIgniter yet, although I intend to. But my grasp of MVC comes from Objective-C and k assume it is much the same regardless of language. View: as out say, this is what the use sees - the interface. Model: this is the data structure and the data itself. Controller: the bit in between that reacts to user input or events and gets data from the model and presents it to the view, altering it if required. So the Controller is where the scripts go. Hopefully someone with a better grasp of these concepts than me, will be able to step in here if I have got it wrong. Cheers, Sarah On Sunday, May 16, 2010, Ian Wood revl...@azurevision.co.uk 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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: revigniter - Model-View-Controller in Rev terms?
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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: revigniter - Model-View-Controller in Rev terms?
It might be easier to think of a real-world example to use MVC in. Try not to analogize MVC with something in Rev or another environment that you may be used to, because what usually ends up happening is that one ends up sledgehammering a concept into a box that it doesn't quite fit into, damaging the perception of what that concept actually is. Try taking something a bit more concrete, that you understand very well, and create a mental picture of what the Model, View(s) and Controller(s) might be for it. For example: a checking account. The model is strictly data. It could be a file on your hard drive, a database entry on a remote server, or even your balance book. The controller becomes the method by which the data in the model is changed. For our checking account, presumably there will be functionality to withdraw and deposit funds, transfer to another account, etc. The controller is how the user does this. The controller could be HTTP commands, functions in a script, or even the teller at your local branch. The controller doesn't even have to be a user interface. For example (purely for show): http://chase.com/deposit?acct=2938302amnt=12.43 The view - on the other hand - is nothing more than the fetching and representing of the data associated with the model. It could be a bar graph showing deposits vs. withdraws over a period of time, or just a field displaying the current balance. It could be an ATM machine, a mobile phone, a web page, or something else. And just like the controllers, there can be many views all functioning at once giving you many different views of the exact same data set. What's important here is that each of these components are independent of each other, and they don't even need to all be present [together] to have a functioning application. In fact, most MVC architectures are set up in such a way that this paradigm is magnified. In our example, the model is on a remote server at a bank. There are many views, and many controllers. Which view you are using right now has absolutely no bearing on what controller you happen to be using and vice-versa. You could be standing at an ATM making a deposit and see the new balance instantly on your Blackberry. Hope this helps some, Jeff M. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: revigniter - Model-View-Controller in Rev terms?
Thanks Sarah, Ralf Jeff, I've read through the MVC pages in the revIgniter docs again and it's making more sense. I can see that it'll be enormously powerful when understood. Watch this space. ;-) Ian ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution