Showing posts with label Workshop. Show all posts
Showing posts with label Workshop. Show all posts

Tuesday, May 25, 2010

Workshop 8

Ruby on Rails Workshops Report and Evaluation

Topic objectives


Upon the completion of this workshop, developers or managers should be able to:

· Identify and evaluate the Ruby on Rails workshop series

· Think critically and analytically about what you knew before and after the experiences

· Share and post your Report and Evaluation with peers via the subject forum.


Evaluation and Report

Please answer each question in this evaluation section. In your answer, please consider content/topics presented and the technologies and teaching strategies used during the Ruby on Rails Workshops. Results will be collated and used to modify the workshop series.

This form is just a format guide to you evaluation and report. Thank you for your time to complete workshop 8.

1. List what you consider to be the three strengths of Ruby on Rails workshop series

I consider the 3 strengths to be:

  • Introducing the new Web framework Ruby on Rails, which is the star to come
  • Giving the students a structured approach to understand the RoR language
  • Allow different roles that suit the individual environment

2. List what you consider to be the three weaknesses of Ruby on Rails workshop series:

I consider 3 weaknesses to be:

  • Many typos, difficult to follow
  • The material is about two years old, not up-to-date
  • Focus on the RoR only, not include other popular frameworks

3. List what aspects of Ruby on Rails workshop series that you found to be most difficult.

The most difficult aspects were:

  • Quite in-depth, difficult for the students do not have programming knowledge, like me
  • The information are not correct, very difficult to follow, e.g. the syntax of command is wrong.


4. List what improvements could be made to the Ruby on Rails workshop series:

Improvements I wold make include:

  • Having option for the students do not have programming technique
  • Linkage to the networking system, e.g. Layer 3 operation

Free response and reflective questions:


5. Reflect on your experiences with the other Web framework used in this subject: Was it effective? How can it be improved? Should other Web frameworks be used as well or instead of Ruby on Rails?

  • Although this subject is immensely difficult for me, this subject is very good to have an idea for the Web 2.0 world. This subject can be improved by:
    • Correcting the typos
    • Update the information
    • Having the study guide opened and linked to web sites to get the latest information

6. Did the Developer’s or IT managers Team that you joined after workshop 4 have a preference towards using other tools to facilitate collaboration? Comment on the differences between these use of the sub-forum or Interact wiki tools from your experiences in this subject.

  • It looks RoR is really a good technology, but it looks the performance and scalability is a big issue so it's not the main stream despite the good things.

7. Further comments to add?

  • This subject is really a good experience.

Workshop 7

End of the Line: production site migration and maintenance

IT INFRASTRUCTURE MANAGER’S THREAD (BLUE team)

To Do:

What are the hosting solutions?

Will our Rails applications run on a cloud computing service in future?

Can we make a deployment and maintenance plan by team consensus?

Build upon the Blue team wiki inside Interact, from Workshop 6 by beginning a new page to add your ideas for policy planning and documentation about production site deployment and maintenance solutions.

Administration, scaling, reliability and integration with existing and future services are issues.

Consider all the business options of both in-house deployment and outsourcing as shown by hosting sites like http://www.engineyard.com/


In-House Development vs. Outsourcing

There are many hosting solutions available in the market, each of them has different characteristics and benefits. But before choosing the platform, the more important business decision should be made, that is: whether the web hosting should be built in-house or outsourcing. This consideration is not new, especially in the years of slow economics where cost is a critical factor. More, the emergence of the utility computing (pay per usage) and the technology of Cloud computing makes the decision more precedent to the choice of hosting solutions.

To decide in-house or outsourcing, pros and cons have to be evaluated. According to a Forrester Research report, financial saving is a big proponent, the 'IT shops that outsource infrastructure management and application services can expect to save 12% to 17% annually on average, which means U.S. companies are sitting on about $10 billion in potential savings'. (Networkworld, 2010). From another research by PricewaterhouseCoopers, 40% of outsourcing companies said they want to improve customer relationships. Another 37% uses outsourcing to develop new products or services, and about one-third wants to expand to other locations. Besides the monetary saving, the data security or confidentially is the major reason from using outsourcing, especially the financial institutions and government bureaus.


Networkworld.com. (2007). Outsourcing vs. keeping it in-house. Retrieved on 25 May 2010 from http://www.networkworld.com/news/2007/102607-arguments-outsourcing-inhouse.html?nwwpkg=50arguments&ap1=rcb


According to the Executive white paper from Verizon, there are ten benefits of the outsourcing. (Verizon, 2004).

  1. More profitable use of valuable in-house IT talent
  2. Reduced IT overhead
  3. Reduced capital expense
  4. Improved IT performance and reliability
  5. A technology edge over competitors
  6. Access to different skills and technology as needed
  7. Accelerated development and time-to-market cycles
  8. Reduced risk of unscheduled downtime
  9. Smoother, less costly technology migration
  10. Business contingency and continuity capabilities

Verizon. (2004). The IT Outsourcing Dilemma. Retrieved on 25 May 2010 from www22.verizon.com/it/files/outsourcing_dilemma_wp.pdf


Come back to the taxi company, the security is not the major concern because the database consists of mainly passengers location information instead of financial transaction. (not all customers will pay by credit card). All the 10 benefits above are directly applicable. Therefore, the final decision is to maintain a small in-house team over the new technologies and features development to stay ahead of competitors and improve customer experience. Other operations like the physical hosting of servers and networks, backup...etc. would be outsourced.

Choosing a Web hosting solutions

From the workshop 6, we have found that Ruby/RoR and Python are the best choices for building Web 2.0 startup and we have decided the Ruby on Rails is the right choice for Taxi online system.

Engine Yard, is 'a Rails Application Cloud for web developers and web teams running on top of cloud computing infrastructure. It provides easy-to-use, automated Rails application deployment and management, with a design philosophy that allows easy migration of your existing applications.'. (Engine Yard, 2010). The features vs. our requirement are listed below:

Requirements
Features
Benefits
Administration

Monitoring & Alerting


Engine Yard Cloud tracks all the essential resource utilization for your application and alerts you when you need additional capacity, or when your latest application push is behaving poorly. Storage, CPU and memory utilization levels are all tracked for conformance to pre-configured thresholds, and email alerts provide timely warnings.
Administration

Self-Service Provisioning


Use the Engine Yard Cloud user interface to add and subtract instances on demand. Our Cloud dashboard makes it easy to see the status of your application, and to add and remove capacity or deploy new application versions.
Scaling

Managed Application Runtime


Engine Yard Cloud provides you with a pre-integrated, pre-tested Ruby on Rails technology stack, including web, application and database servers, built-in monitoring and process management, a Rails-optimized linux distribution, in-memory caches and more. All components are monitored for security vulnerabilities and updated continuously as vulnerabilities are discovered and patched.
Scaling

Seamless Application Capacity Management


Configuring new applications capacity used to be a multi-hour task—now it’s a single click. With Engine Yard Cloud, capacity management is always application aware. Add an additional instance to your application tier, and that instance will automatically deploy with the correct application configuration and join your load-balanced group.
Scaling

Auto Deploy-From-Source


Engine Yard provides seamless integration with source code management. Simply add a special comment to your source code check-in and you can have it automatically deploy to a staging or test environment. Now your whole team can always see the current application version.
Scaling

Application Templates


One of the essential concepts of an Application Cloud is that all the information required to reproduce application capacity is stored in a configuration management system. With Engine Yard Cloud, you can easily manage application configurations with our application templates, which encapsulate source code, Ruby gems, linux packages and other essential details.
Scaling

Extensible Configurations


If you need to use a component or package that Engine Yard does not install or configure by default, you can write a configuration recipe to extend our configuration management system. A configuration recipe is a simple Ruby-based domain specific language that allows you to specify installation and configuration steps for any package you need to install.
Reliability

Replicated Database Tier


As your application scales, so should your database. With Engine Yard Cloud, adding a database read replica is as simple as clicking on a button. Scale out by adding more replicas, which can be used to perform complex analytics, backups and maintain high availability without sacrificing on application performance.
Realiability

URL Availability Monitoring


Serious production applications require all services to be available at all times. Engine Yard Cloud monitors all your essential services, including configurable application URLs, and alerts you when there is any unexpected downtime.
Integration

Utility Tier


Most serious web applications require specialized components outside of the application and database tier. With Engine Yard Cloud, you can easily create a utility instance tier and associate configuration recipes to it. Simply add new servers to do repeatable deploys of custom applications or to offload complex processing to dedicated servers.

Workshop 6

Enjoying the Ride: Web framework alternatives, scalability and flexibility

Topic objectives

Upon the completion of this workshop, developers or managers should be able to:

· Discuss and analyse the latest Web framework technologies based upon experiences so far with Ruby on Rails

· Identify and evaluate challenges and opportunities concerning the use of the latest Web 2.0 technologies and to ‘benchmark’ (compare) other alternatives;

· Discuss and evaluate current Ruby on Rails framework and the alternative emerging technologies.

· Evaluate and devise scalability, flexibility, capacity planning and performance testing strategies for conducting e-commerce.

· Deploy Web 2.0 or later technology in their business environments such as the ideas and methods of the ‘RailsSpace’ approach to the OTBS

· Think critically and analytically when exposed to new technologies.

· Share your findings with your peers and examine what the other team is doing.

IT INFRASTRUCTURE MANAGER’S THREAD (BLUE team)

To Do:

Are we certain that Ruby on Rails is the right platform for Web development?

Your findings should answer that question using the Blue team wiki inside Interact.

Blue team IT managers need to write a team report on the wiki about the alternative frameworks, focusing on issues of scalability, flexibility. In addition a plan for capacity planning, performance testing, site maintenance and future development of the OTBS is presented. Chapter 17 of Hartl et al (2008) is a good place to start. The structure and content and comments made in the wiki report is up to you and your team members.

[This is open to include current alternative frameworks offered by Google Apps, JQUERY, Django, Adobe as well as Java and .NET frameworks that can be included. Your research may also expand the scope to include content management systems.]


The Web 2.0 is no longer a static Web page to show something, the Web 2.0 websites are more interactive with the viewers to receive as well as provide information. According to Tim O' Reilly, the Web 2.0 'can build on the interactive facilities of "Web 1.0" to provide "Network as platform" computing, allowing users to run software-applications entirely through a browser. Users can own the data on a Web 2.0 site and exercise control over that data. These sites may have an "Architecture of participation" that encourages users to add value to the application as they use it.
(O'Reilly, 2005)

O' Reilly, T. (2005). What Is Web 2.0. Retrieved on 24 May 2010 from http://oreilly.com/web2/archive/what-is-web-20.html

The Ruby and Rails is a web development framework that enables the Web 2.0 websites to be easily constructed, the major features can be summarized as below. (LinuxJournal.com, 2008)

  • MVC architecture: Ruby on Rails is based on the MVC (Model View Controller) architecture that enables the data to be separated from presentation.
  • Database Access Library: Ruby on Rails includes a database access library - Active Record - that simplifies data handling in databases. Active Record automatically maps tables to classes and rows to objects.
  • Libraries for common tasks: Ruby on Rails includes a host of libraries that simplify the coding of common programming tasks such as form validations, sessions management, etc.
  • AJAX Library: An extensive library of AJAX functions is provided in the Rails framework. Ruby code can be used to generate AJAX code. The associated java scripting required for AJX gets generated automatically.
  • Convention over configuration: Ruby on Rails does not have any XML configuration files. It includes simple programming conventions that can be used to specify the configuration parameters.
  • Customized URL: Custom or Search Engine Friendly URLs can be developed using the Ruby on Rails framework.
  • Debugging: Detailed error logs are provided, making it easier to debug applications.
  • Components: Components can be used to store reusable code. Components can
  • be included to modularize templates.

LinuxJournal.com. (2008). Ruby on Rails Features. Retrieved on 24 May 2010 from http://www.linuxjournal.com/content/ruby-rails-features-railsonrubycom


Besides RoR, there are many Web development platforms on the market, e.g. PHP, Java, .NET, Google Apps... many more. All these frameworks are adopted by different camps and all the proponents support their favor from their point of views. There is no 'absolute' objective comparison because the features and operating environments could be vastly different.

A 'qualitative' comparison by Tim Bray, the Director of Web Technologies of Sun Microsystems, was done by comparing the different Intrinsics. The intrinsics are used to handle issues as below:

Intrinsics
Issues
Scaling
Load Balancing, CPU, Observability, File I/O, Sharing-nothing, DBMS
Developer Speed
Compilation Step, Code Size, Development Step, Configuration Process
Development Tools
IDE, Templating, How many tools? O/R Mapping, Performance, Documentation
Maintainability
MVC, Language count, Object Orientation, Code Size, Readability


After consideration of the factors, below is the comparison.




From this comparison, the RoR is good at Development Speed and Maintainability, but not the Scaling and richness of Developer Tools



Bray, T. (2008). Issues in Web Frameworks. Retrieved on 24 May 2010 from http://www.tbray.org/talks/php.de.pdf


Another comparison is done by Sergii Gorpynich, the CTO of Cogniance and leads Cogniance engineering team, five web frameworks are compared: (Gorpynich, 2010)

Web Framework Technologies

J2EE/EJB3

J2EE/Spring-Hibernate

Ruby/RoR

LAMP/Python

LAMP/PHP

.NET


The comparison is based on below factors.

Speed of development - this parameter defines how quickly, easily and with what level of quality you can implement typical features of your web solution - such as user registration and profile management forms, RSS and podcast feeds, browser-based logic etc.

Performance - this defines the degree of scalability and responsiveness of your solution.

Level of adoption by the industry - this factor defines how much of an industry standard given technology is. When defining this criterion, things such as number of well-known web products built on this technology, size of the supporting community, availability of documentation and other learning materials should be taken into consideration.

Learning curve - a level of effort and time required for the project team to develop expertise with this technology. The less known the technology is, the higher the learning risk would be.

Cost of ownership - this variable defines total cost of ownership and includes initial acquisition costs, operating and maintenance costs, and (possibly) switching costs.



By summing the total points, the final result is:



The conclusion here is:


Cumulative data across all requirements suggests that currently Ruby/RoR and Python are the best choices for building Web 2.0 startup, with PHP and Java being good alternatives. .Net is significantly behind its competitors and can hardly be a recommendation.




Gorpynich, S. (2010). Web 2.0 startups. Choice of server-side. Retrieved on 24 May 2010 from http://www.cogniance.com/expertise/white_papers/web2.0-technology-choice


Final Verdict:


Ruby on Rails is the right platform for Web Development.

Sunday, May 23, 2010

Workshop 5

Workshop 5 - IT INFRASTRUCTURE MANAGER’S THREAD

To Do:

Part A: Survey of mobile device capability and Web 2.0 tools

  1. Find out and recommend what type of mobile devices are suitable for:

    1. Just the SMS message service;

    2. The full user experience via SMS, GPS Taxi tracking and Google Maps


A mobile device (also known as cellphone device, handheld device, handheld computer, "Palmtop" or simply handheld) is a pocket-sized computing device, typically having a display screen with touch input or a miniature keyboard. (Wiki, 2010). Most people nowadays posses at least one mobile device, and mobile phone (or called hand phone, cell phone) is certainly the most common one. To receive the SMS message, a ordinary mobile phone is sufficient. To have full user experience via SMS, GPS Taxi tracking and Google Maps, then a smartphone is required.

The Smartphone is a mobile phone with much more processing power, memory and running on a more sophisticated operating system (OS). Based on a survey by ComScore, in 2010, smartphone grows quickly, there are over 45.5 million people in the United States owned smartphones and is continue to grow rapidly out from the subscribers market of 234 million users. (Gonsalves, 2010)

The basic requirement for SMS, Google/ Google Maps requires the smartphone to be web-enabled, while the GPS needs an additional hardware to pick up GPS signal. All the new smartphone OS supports web operation, and the 2010 Q1 market share is listed below. (Garnter, 2010)




Some of the latest smartphones with WiFi and GPS are listed below. (May 2010)


Brand
model
OS
Band
Nokia
5800 XpressMusic
Symbian OS9.3
Quad + 3.5G

C5
Symbian OS9.3
Quad + 3.75G+

E52
Symbian OS9.3
Quad + 3.75G+

N97
Symbian OS9.4
Quad + 3.5G
Samsung
Anycall i8910HD
Symbian OS9.4
Quad + 3.75G+
SonyEricsson
Satio
Symbian OS9.4
Quad + 3.75G+
HTC
Desire
Android 2.1 Eclair
Quad + 3.75G+

Legend
Android 2.1 Eclair
Quad + 3.75G+
Motorola
Mulestone XT701
Android 2.1 Eclair
Quad + 3.75G+
Garmin-Asus
M10
Windows Mobile 6.5.3 Professional
Quad + 3.75G+
HTC
HD2
Windows Mobile 6.5 Professional
Quad + 3.75G+
Samsung
Anycall Omnia Pro B7330
Windows Mobile 6.5 Professional
Quad + 3.75G+
Blackberry
Bold 9700
Device Software 5.0
Quad + 3G

Apple iPhone


3GS 32GB
iPhone OS 3.1.3
Quad+3.5G



2. Describe any new hardware, networking, software, systems, procedures and personnel that would be needed by the taxi company Website to support this stage 2 development.

The taxi company can locate the taxi location by the Google Latitude apps. What the taxi company needs to do is to attach an link to iGoogle and register all the taxis' GPS devices. (mobile phones). The Google map can show the registered taxis on the Google map.

There is no additional hardware or networking and systems for the Google latitude, but a SMS gateway that connecting to the taxi company's server that sending the Link of specific taxi location on Google latitude should be added. For the procedures and personnel, there are no additional requirement neither.

Part B: The enhanced customer experience through Web 2.0 technology

  1. Use a table to describe how the customer experience is improved by:

    1. Horizontal scalability (eg ordering a taxi by mobile phone call or SMS, mobile Internet, desktop or laptop computer)

    2. Service oriented features (eg SMS updates using location data, knowing the driver’s name before the ride and being greeted by your name etc)

    3. Other customer services enabled by Web 2.0 (eg reputation system)






Improve customer experience by
Examples
Horizontal scalabilityOrder taxi by mobile phone call, mobile Internet, desktop or laptop computer, then reply by an SMS to confirm the reception

Service oriented featuresSMS message should be sent to the client with below information
- The current location of the taxi
- Estimated time to arrive
- Link to Google map and show the distance and projected path
- Name of the taxi driver, license no. of the taxi
Other customer servicesAdditional service should be considered
(1) For security
- When a lady taking the taxi in midnight, she can ask sending SMS about the trip information to her husband or friend
- Camera at the back of seat, point to the driver and front road, make sure it is driving in a correct manner

(2) 'Frequent Rider' program
- The client can select to join the program by registering on the web, then sending a SMS informing the points accumulated after each trip. When getting to a certain points, give discount to encourage the client to use this taxi company again.
- Align with telecom operator, gives free news or weather information when getting to a certain point

(3) Vochurer program
- By pre-paying a certain amount of money, the Client doesn't need to pay every time, and can have discount on each ride.

Part C: Online Taxi Business Process Modelling

Apart from the business basics of offering a clean car, safe driving, being on time, consider the business processes involved and construct a Simple Online Taxi business process model using any suitable drawing tool.


The following description is a helpful guide, but don’t be restricted from including your own ideas to extend or limit the business process model:


  1. BEFORE the RIDE

    1. The business process will begin with ordering the cab by telephone, SMS, or online and getting customer recognition if the customer has made a booking previously.

    2. During registration, the company would collect data for good customer relations and the electronic payment method. All data collected has to also achieve a quick ordering process and be used ethically and securely.

    3. SMS reminders, and updates via SMS, GPS and Google maps provide location-based information to re-assure that the taxi is on the way and on time for the booking.

  2. DURING the RIDE

    1. When the taxi arrives, the driver greets the customer by name and helps them with their luggage and then opens the car door.

    2. The taxi driver would initiate a conversation and continue with it if they are interested or show interest if they started talking first.

  3. END of the RIDE

    1. At the end of the ride there is no delay for making a payment so the taxi driver would help the customer get out of the car and would have their luggage ready waiting for them and say goodbye.

    2. The business process concludes when the company uses the taxi vehicle’s GPS location data again to send a final friendly thank you, suggests feedback via SMS and offers a goodbye message.











References

Gartner. (2010). Gartner Says Worldwide Mobile Phone Sales Grew 17 Per Cent in First Quarter 2010. Retrieved on 22 May 2010 from http://www.gartner.com/it/page.jsp?id=1372013


Wiki. (2010). Graph showing smartphone marketshare for 2010. Retrieved on 22 May 2010 from

http://upload.wikimedia.org/wikipedia/en/3/3e/Smartphone_share_2009_full.png

Wiki. (2010). Smartphone. Retrieved on 22 May 2010 from http://en.wikipedia.org/wiki/Smartphone


Friday, April 16, 2010

Workshop 3

1. Set up the MySQL tools on your computer as described in section 6 above.

The GUI tool is called MySQL Workbench, and is downloaded from http://www.mysql.com/products/tools/. The latest GA version is 5.1.18a. A Microsoft MSI installation file is available. After installation, it is running successfully and the screen shot is as follow.




2. Rails will setup a new application directory for each of your Web application projects. Get InstantRails (Windows) or Locomotive (MacOS) running on your machine. Both packages install Ruby, Rails, a Web server or one called ‘Mongrel’ or another small Ruby Web server called ‘WEBrick’, and MySQL “inside a bubble” as I call it so that others parts of your system are not modified (Similarly ZOPE does with installing its own Web server and Python versions).

I did not install InstantRails, but the Ruby and Rails from rubyforge.org. The version is 1.86-27, it is an older one but stable.




The RoR is installed successfully, and the folder c:\Ruby is created.

In this version, the RubyGems is not necessary to installed separately. But according to the installation instruction, two instructions to update the RubyGems are required.


C:\rudy> gem update rails

C:\ruby>gem install rails—include-dependencies (takes quite a while)

After installation is completed, the online taxi booking system (OTBS) is created by running command from the Ruby folder.





Associated folders are created.








To start the WEBrick server, below command is run at the c:\ruby\otbs folder.










3. Once Rails is running you at http://localhost:3000, you need to configure database access. Connection to the database is specified in the config/database.yml file.

The port at 3000 of Rails is running as shown as follow:





The detail of the config/database.yml is shown below. The database that connected from three environment ‘development’, ‘test’ and ‘production’ are specified by default.




4. Generate the Passenger model by creating the MySQL database and ‘passengers’ table from the information above.

The procedure can be straightly followed through the Ruby on Rails instructions:

(a) Showing options by running without parameters





(b) Running script/generate command with table ‘Passengers’ and columns





The models and controllers folders are created





(c ) Run rake command to migrate the database


















Monday, April 12, 2010

Worshop 4

To do:

1. Spend some time moving your way through the 46 Ruby coding examples in the Ruby Tutorial with Code from http://www.fincher.org/tips/Languages/Ruby/


2. What are the syntax differences in the way that Ruby and Javascript use the if statement?
Below is a simple example comparing the basic syntax.
JavaScript
if (card > 21) {
document.write("busted");
} else if (card == 21) {
document.write("won");
} else {
document.write("continue");
}
Ruby
if card > 21
print "busted"
elseif card == 21
print "won"
else
print "continue"
end


3. While Ruby and Python are quite similar, can you find some similarities between Ruby and Javascript?

The main similarity between Ruby and Javascript is quite fundamental; they both have similar syntax and are object-oriented language.


Challenge Problems:

1. Create, test and debug a Ruby program called dognames.rb or catnames.rb to accept 3 names from the keyboard and to display each name on the screen in alphabetical order WITHOUT using a data structure such as a list.




2. Write a Ruby program called fizzbuzz.rb that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".





3. Compare the Ruby and Python versions of the dog years calculator:

#!/usr/bin/ruby
# The Dog year calculator program called dogyears.rb

def dogyears
# get the original age
puts “Enter your age (in human years): "
age = gets # gets is a method for input from keyboard
puts # is a method or operator for screen output

#do some range checking, then print result
if age <> 110
puts "Frankly, I don't believe you."
else
puts "That's", age*7, "in dog years."
end
dogyears

Python

#!/usr/bin/python
# The Dog year calculator program called dogyears.py

def dogyears():
# get the original age
age = input("Enter your age (in human years): ")
print # print a blank line

# do some range checking, then print result
if age <> 110:
print "Frankly, I don't believe you."
else:
print "That's", age*7, "in dog years."

### pause for Return key (so window doesn't disappear)
raw_input('press Return>')

def main():
dogyears()
main()

Comparsion:

Ruby Python
File extension rb py
Function quotation No quotation ():
Remark # #
Prompt Puts “ “ Input (“ “)
End of loop 'End' statement No need to put ‘End’ Statement

Thursday, March 25, 2010

Workshop 2

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.

I have set up a study group called Team 007 in Wiki took, at CSU’s Interact Intracnet.


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

From the Wiki definition, Convention over Configuration (CoC) 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.’

CoC reduce coding by relating the database to the class by default, e.g. the corresponding table in a table with the class ‘Sale’ will be automatically named as ‘Sale’. Unless there is exception, then needs to be specified.


3. Further work on understanding MVC:

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

Error message ‘This topic does not exist’

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

The tutorial described the origin of MVC.

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

How can this guy keep speaking that fast?

References

Wikipedia. (2009). Convention over Configuration. Retrieved on 26 March 2010, from http://en.wikipedia.org/wiki/Convention_over_configuration



Challenge Problems:

1. How is Rails structured to follow the MVC pattern?

Consider our project and examine the directories where Rails is located. If the data model is called Taxi (it is convention to name the model beginning with an upper case letter).

The model is a Ruby class located in app/models/taxi.rb

The SQL table is taxis – the pluralisation of the model. In our project we have 2 tables as passenger_origin and passenger_destination, where the table row = an object instance and each of the columns = an object attribute.

The controller methods live in app/controllers/taxi_controller.rb
Each controller can access templates to display the input screen and methods for action.

The views are kept is app/views/taxi/*.rhtml, where each *.rhtml maps to a controller method.


In Rails, the view is rendered using RHTML or RXML. According to the wiki page at http://wiki.rubyonrails.org/rails/pages/UnderstandingViews, RHTML is HTML with embedded Ruby code and RXML is Ruby-generated XML code.


From the Wiki, Rails use the Model-View-Controller (MVC) architecture as a design framework. (Wiki, 2010) When an application is created, the data of a specific application (like the Taxi) is stored in a directory structure with folder 'app/controllers', 'app/views' and 'app/models'

More about the directory structure is set up. Below is the example extracted from a RoR tutorial. (Ruby on Rails 2.1.x - Directory Structure, n.d.)

The application is called demo, steps below.

C:\ruby\> rails -d mysql demo

Now go into demo application root directory as follows:
C:\ruby\> cd demo
C:\ruby\demo> dir

You will find a directory structure as follows:
demo/
..../app
......../controller
......../helpers
......../models
......../views
............../layouts
..../config
..../db
..../doc
..../lib
..../log
..../public
..../script
..../test
..../tmp
..../vendor
README
Rakefile

References
Tutorial Points. (n.d.).Ruby on Rails 2.1.x - Directory Structure. Retrieved on 26 March 2010 from http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-directory-structure.htm

Friday, March 12, 2010

Workshop 1

1. Make a list of all programming languages and Web development tools used by you in prior experiences. Describe what you know about Web application frameworks before we begin.


I came from a hardware background, so my programming skill is very limited. I have learnt the basic XHTML syntax coding and Dreamweaver CS4 as my only web development tool from the Multimedia programming course.


2. Ruby is “an interpreted scripting language” for quick and easy object-oriented programming”. Find out about the Ruby language and discover what this means.
Ruby is ‘a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.’ (Ruby, n.d.)

Ruby is an interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. (FreeBSD Man Pages, 2002)

In summary, Ruby is a general purpose Object Oriented Programming Language, it was invented by Yukihiro Matsumoto in mid 90’s. Ruby sees all the information in the programming as objects. He extracted and combined some languages like PERL, Python, Small Talk and Lisp to make up a syntax of codes that is similar to English for easy understanding, and leave the difficult part handled by the language itself. (An interpreted scripting language).

3. What is Rails and how does it work with Ruby?


While Ruby is a language, Rail is a web application development framework written in Ruby around 2005. The framework is based on Model View Controller (MVC) structure and very good for The Ruby on Rails works together well and helps to gain great popularity.

Commonly appeared, Ruby on Rails (RoR) is a free open source web development framework based on Model-View-Controller that very good for efficient programming (e.g Agile programming) and yet it is powerful as well.


4. What is meant by “convention over configuration” in regards to the use of Rails in Web application development?

Convention over Configuration (CoC) is a software design principle for rapid development; trying to ‘Don’t Repeat Yourself’ (DRY). The paradigm is to reduce the number of specifications by only defining those parameters not nature. For example, ‘if there is 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 the developer needs to write code regarding these names. Generally, this leads to less code and less repetition.’ ‘"Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using the ActiveRecord of Rails, the developer does not need to specify database column names in class definitions. Instead, Ruby on Rails can retrieve this information from the database based on the class name.’ (Wiki, 2010)

5. When did Model-View-Controller begin and where is it used?

MVC was first described in 1979 by Trygve Reenskaug, then working on Smalltalk at Xerox PARC. The original implementation is described in depth in the influential paper "Applications Programming in Smalltalk-80: How to use Model–View–Controller".

Model–View–Controller (MVC) is a software architecture , currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" (the application logic for the user) from input and presentation (GUI), permitting independent development, testing and maintenance of each. Model–View–Controller (MVC) is a software architecture , currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" (the application logic for the user) from input and presentation (GUI), permitting independent development, testing and maintenance of each.


6. Describe the steps involved with the MVC design approach.

To follow the MVC design, it is required to set up a structure have an isolation between the model (data or database), view (the user interference or presentation) and controller (the application logic). This model can allow isolation development, testing and maintenance.


References


Free BSD Man Pages. (2002). Manual Reference Pages - RUBY(1). Retrieved from http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=ruby on 12 March 2010

Rudy. (n.d.) Home page. Retrieved from http://www.ruby-lang.org/en/ on 12 March 2010

Wiki. (2010). Convention over Configuration. Retrieved from http://en.wikipedia.org/wiki/Convention_over_configuration on 12 March 2010
Wiki. (2010). Model–view–controller. Retrieved from http://en.wikipedia.org/wiki/Model-view-controller#History on 12 March 2010