Sunday, May 17, 2009

Workshop 2: Model View Controller design approach

Topic objectives

  1. Describe the history and architecture of the Model View Controller (MVC) approach to Web application design;
  2. Revise database techniques with Rails and SQL
  3. Describe how to use MVC in the Ruby on Rails development environment
  4. Set up a focus group (like a study group for peer learning) to work on the Ruby on Rails workshops via Interact tools

To do:

1. Set up a focus group (like a study group for peer learning) to work on the Ruby on Rails workshops via Interact tools as a class.

This has been informally done via the forum. We haven't organised a study group, but comments have been forthcoming on issues when they have arisen.

2. What is meant by “convention over configuration” and how does it reduce coding?

(Wikipedia)Convention over Configuration (aka Coding by convention) 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.

The phrase essentially means a developer only needs to specify unconventional aspects of the application. For example, if there's a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products_sold", that one needs to write code regarding these names.

When the convention implemented by the tool you are using matches your desired behaviour, you enjoy the benefits without having to write configuration files. When your desired behaviour deviates from the implemented convention, then you configure your desired behaviour.

3. Further work on understanding MVC:

a. See the wiki at http://wiki.rubyonrails.org/rails/pages/UnderstandingMVC

As Karen pointed out on the forums and I have found out subsequently, there is nothing to be gained by going to this site. This is what grabs you
This topic does not exist yet
As I posted on the forums, Ken may have meant for us to visit http://c2.com/cgi/wiki?ModelViewController

b. Do the MVC tutorial at http://wiki.squeak.org/squeak/1767

I have visited this URL and downloaded the tutorial which is in a nice small zip file. Unzipped the file and then looked at the contents page which said that the tutorial was to develop and MVC application in Smalltalk. Not sure about anyone else, but I decided then and there that I didn't need to learn yet another syntax just at the moment.

4. Got a spare hour or so? I recommend the UC Berkeley RAD lab’s Ruby on Rails Short course at http://YouTube.com/watch?v=LADHwoN2LMM

I watched this yesterday. I found this to be very useful in bringing the concepts talked about in the podcast LearningRails episodes to light. He does speak a little quickly, but he is definitely enthusiastic.

5. Read the Flash article using ActionScript by Colin Moock titled “The Model-View-Controller Design Pattern “at http://www.adobe.com/devnet/flash/articles/mv_controller.html

I have read this article. Got enthusiastic enough to download the entire chapter. The full chapter explains how the author builds an MVC Clock that displays digital and analog time. Unfortunately I didn't actually gain a lot from the rest of the chapter. It contains a lot of code with some explanations of how all the pieces fit together, but I felt that he laboured the point just a little.

References

Wikipedia. Convention over configuration. Retrieved 11 June 2009, from http://en.wikipedia.org/wiki/Convention_over_Configuration

No comments:

Post a Comment