Saturday 9 May 2009

WK2: Understanding of MVC

Ruby on Rails is adopting the principle of Convention over configuration.

What is Convention over configuration?

It is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.

When the convention implemented by the tool you are using matches your desired behavior, you enjoy the benefits without having to write configuration files. When your desired behavior deviates from the implemented convention, then you configure your desired behavior. In brief, you would write less code and less repetition (Wikipedia 2009).

What is MVC?

I qouted the following paragrahs from (Squeak 2006).

MVC stands for Model-View-Controller, which is a paradigm that the user input, the modeling of the external world, and the visual feedback to the user are explicitly separated and handled by three types of object, each specialized for its task.

The view manages the graphical and/or textual output to the portion of the bitmapped display that is allocated to its application.

The controller interprets the mouse and keyboard inputs from the user, commanding the model and/or the view to change as appropriate.

The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

After reading the article, "The Model-View-Controller Design Pattern", I can grasp the concept of MVC much better. It illustrates the application of MVC very well by a simple program design. It describes the responsibilities and the characteristics of Model, View and Controller in the design plus the interactions among those three. The followng illustrate the responsbilities of MVC in the program design.



Source: Moock C (2004) http://www.adobe.com/devnet/flash/articles/mv_controller.html

The MVC paradigm can be applied to a full scale project or just a button on an user interface of an application.


References
Moock C (2004), The Model-View-Controller Design Pattern, Adobe Developer Connection, viewed 10 May 2009, <http://www.adobe.com/devnet/flash/articles/mv_controller.html >.

Squeak 2006, MVC, last updated 16 Jan 2006, Squeak Swiki, viewed 9 May 2009, <http://wiki.squeak.org/squeak/1767>.

Wikipedia 2009, Convention over configuration, Wikipedia, The free encyclopedia, last modified 3 May 2009, Wikimedia Foundation, Inc., US, viewed 10 May 2009, ,<http://en.wikipedia.org/wiki/Convention_over_Configuration>.

No comments: