Ruby on Rails installation....
I tried to follow the Ruby on Rails installation procedures found on different wikis and multitude of websites, however the installation process would always fail and the system returned a cryptic message or crash. This was until I found a tutorial on YouTube which provides step by step instructions in a very palatable way (for someone uninitiated like myself) on how to proceed with the installation and initial configuration. This includes installing Ruby on Rails in Windows environment, MySQL database and HeidiSQL management tool for MySQL.
The tutorial can be found under the following link:
http://www.youtube.com/watch?v=dQrqpXFDrh
What is meant by “convention over configuration” and how does it reduce coding?
Convention over Configuration (also known as 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.
Work Shop 3
*** To Do ***
1. Set up the MySQL tools on your computer.
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).
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.
4. Generate the Passenger model by creating the MySQL database and ‘passengers’ table from the information above.
5. Further work on understanding MySql under Rails
The MySql tools have been set up on my test machine.I also install Ruby on Rails and RubyGems.
Further proceedings are presented in the image below and were executed in the terminal window in MS Windows XP SP2:

Once the Webrick server is activated and running Rails default "Welcome Aboard" page shows up.
Work Shop 4
Question 2:
What is the difference in the way that Ruby and Javascript use teh IF statement?
Ruby syntax for the IF statement is as follows:
if conditional [then]
code...
[elsif conditional [then]
code...]...
[else
code...]
end
For example:code...
[elsif conditional [then]
code...]...
[else
code...]
end
#!/usr/bin/ruby
x=1
if x > 2
puts "x is greater than 2"
elsif x <= 2 and x!=0
puts "x is 1"
else
puts "I can't guess the number"
end
Javascript IF statement looks as follows:x=1
if x > 2
puts "x is greater than 2"
elsif x <= 2 and x!=0
puts "x is 1"
else
puts "I can't guess the number"
end
if (condition)
{
code to be executed if condition is true
}
else
{
code to be executed if condition is not true
}
For example:{
code to be executed if condition is true
}
else
{
code to be executed if condition is not true
}
Apart for some minor syntax differences these two code samples are logically similar and easy to interpret. Question 3: While Ruby and Python are quite similar, can you find some similarities between Ruby and Javascript?
I cannot regard myself as a seasoned or even average programmer (most of my experience relates to SQL or Transact-SQL code) so spotting the differences would be rather unsuccessful exercise. However, the website Jvascript Kata lists some common aspects of those two languages under the following link:
http://www.javascriptkata.com/2007/04/05/3-things-that-javascript-and-ruby-have-in-common/
Resources:
http://www.tutorialspoint.com/ruby/ruby_if_else.htm accessed on 14.04.2010
http://www.w3schools.com/js/js_if_else.asp accessed on 13.10.2010
http://www.javascriptkata.com/2007/04/05/3-things-that-javascript-and-ruby-have-in-common/ accessed on 15.10.2010
Workshop 5
Part A: Survey of mobile device capability and Web 2.0 tools
- Find out and recommend what type of mobile devices are suitable for:
- Just the SMS message service;
- The full user experience via SMS, GPS Taxi tracking and Google Maps
- 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
Answer 1a:
In order to send just a simple SMS message a mobile device is a pocket-sized computing device, typically having a display screen with touch input or a miniature keyboard is required, however, SMS can also be send from computers as well as communication devices which transmit data (voice) via VoIP. SMS is considered to be the most basic communication method using mobile technology and thus not requiring a powerful set-up or device.
Answer 1b:
In order to achieve the full user experience i.e. SMS, GPS tracking or Google maps a more powerful and potent technology needs to be implemented. Today's mobile CPUs have as much power as desktop computers a decade ago and are capable of processing more demanding information in larger volumes. Smarphones are typically devices which provide a plethora of functions without compromising speed and convenience. These can include but are not restricted to inbuilt GPS receivers which in conjunction with Internet downloadable maps can function as a tracking device. They also provide Internet connectivity for Web access, games with advanced graphics or e-mail functionality.
Answer 2:
The following are suggested for stage 2 development setup:
a) Hardware
* PCs workstations for the company's staff and a range or peripherals including printers and faxes.
* PCs workstations for the company's staff and a range or peripherals including printers and faxes.
* Servers running application hub which controls the booking system as well as servers for office functionality specific to applications/vendor implemented by the company e.g. Microsoft Exchange or SQL Server.
* Telephones
* GPS devices in each taxi for GPS tracking.
* Mobile EFTPOS machines in each taxi for payment.
* Monitoring and booking devices in each taxi to allow drivers to receive and action booking.
b) Software
* Operating system on PCs.
* Taxi Booking Software running on PCs.
* Software for additional functionality e.g. e-mail client or MS Office applications.
c) Networking and Systems
* Telephones
* GPS devices in each taxi for GPS tracking.
* Mobile EFTPOS machines in each taxi for payment.
* Monitoring and booking devices in each taxi to allow drivers to receive and action booking.
b) Software
* Operating system on PCs.
* Taxi Booking Software running on PCs.
* Software for additional functionality e.g. e-mail client or MS Office applications.
c) Networking and Systems
* Switches and Internet connectivity equipment
* Security hardware e.g. firewall
d) Personnel
* Trained staff for performing administrative duties and liaising with customers.
* Taxi drivers
d) Personnel
* Trained staff for performing administrative duties and liaising with customers.
* Taxi drivers
* Management
Part B: The enhanced customer experience through Web 2.0 technology
- Use a table to describe how the customer experience is improved by:
- Horizontal scalability (eg ordering a taxi by mobile phone call or SMS, mobile Internet, desktop or laptop computer)
- Service oriented features (eg SMS updates using location data, knowing the driver’s name before the ride and being greeted by your name etc)
- Other customer services enabled by Web 2.0 (eg reputation system)
Part C: On-line Taxi Business Process Modeling
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:
- BEFORE the RIDE
- 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.
- 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.
- 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.
- DURING the RIDE
- When the taxi arrives, the driver greets the customer by name and helps them with their luggage and then opens the car door.
- The taxi driver would initiate a conversation and continue with it if they are interested or show interest if they started talking first.
- END of the RIDE
- 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.
- 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.
Workshop 6
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.]
I personally would argue that Ruby on Rails is the right platform for web development, however; that does not indicate that it is the best one for all web development projects. There has been plenty of alternative framework which offer similar functionality, speed of development and are open sourced. Many of those are at least as good as Ruby and therefore the choice often boils down to personal preferences, experience and cost of development - all of which Ruby on Rails excels in. The tools of the trade which offer similar functionality and development concepts as well as the differences between them are as follows:
Java:
Java is a programming language which derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to a class file that can run on any Java Virtual Machine (regardless of computer architecture. On the face value it appears that Java is a more powerful and feature rich language, however due to its complexity and extensive abilities it requires a long learning curve (which can also be viewed as a drawback). Ruby is an interpreted scripting language whereas Java is compiled programming language (compiled into an executable as opposed to being interpreted at the time of execution). Ruby is similar to Java in that both are object-oriented and strongly typed. Ruby, however is dynamically typed whereas Java is statically typed. Both Java and Ruby provide inheritance and have public, private and protected methods. Both languages have their strengths and weaknesses and both are capable of outputting desired results in majority of programming scenarios.
Django:
An open source web development framework that utilizes Python scripting language, which follows the model-view-controller architecture pattern. Django's primary goal is to ease the creation of complex, database-driven websites. Django emphasizes reusability and "pluggability" of components, rapid development, and the principle of DRY (Don't Repeat Yourself). Django also provides an optional administrative CRUD (create, read, update and delete) interface that is generated dynamically through introspection and configured via admin models.
Some primary feature comparison is depicted in the table below:
The two frameworks are very much similar in many aspects and there is no clear advantage for a development team to switch from Rails to Django or the opposite. The main difference in choosing between these two applications appears to focus on which programming language is preferred, Python versus Ruby.
CakePHP:
CakePHP is an open source web application framework for producing web applications. It is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License. CakePHP started in 2005, when Ruby on Rails was gaining popularity. The community has since grown and spawned several sub-projects. CakePHP is not a port of Ruby on Rails to PHP, but appropriates many of its useful concepts.
Some key contrasts and differences include:
1. MVC: both follow the MVC pattern (Model, View and Controller) and both are OOP.
2. Naming convention: the smart English recognition provided is helpful (simply you have to call all your DB tables in plural, but both are smart enough to understand that people is the plural of person!).
3. Directory structure: Cake PHP has the same directory hierarchy of a typical Rails application.
4. Web 2.0: Both support AJAX, maybe in a little bit different ways but still both can create AJAX object with ease.
5. Testing: Both were built with testing in mind, you simply provide your application with three databases: testing, developing and production. This way you can always guarantee your testing team leader will be satisfied or you can guarantee a no-white-screen-of-death pages in your application.
6. Plugins: are great addons to Rails while Cake is still laking community, but I think it will sooner attract more developer and I think the white page in Cake PHP's site will one day have some text
7. Caching: caching is supported in both of them.
8. IDE: Ruby on Rails has now many some nice IDE's, they're already MVC ready, while PHP is still laking a good IDE , I still see only Zend Studio offering some real power of an IDE
CakePHP is an open source web application framework for producing web applications. It is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License. CakePHP started in 2005, when Ruby on Rails was gaining popularity. The community has since grown and spawned several sub-projects. CakePHP is not a port of Ruby on Rails to PHP, but appropriates many of its useful concepts.
Some key contrasts and differences include:
1. MVC: both follow the MVC pattern (Model, View and Controller) and both are OOP.
2. Naming convention: the smart English recognition provided is helpful (simply you have to call all your DB tables in plural, but both are smart enough to understand that people is the plural of person!).
3. Directory structure: Cake PHP has the same directory hierarchy of a typical Rails application.
4. Web 2.0: Both support AJAX, maybe in a little bit different ways but still both can create AJAX object with ease.
5. Testing: Both were built with testing in mind, you simply provide your application with three databases: testing, developing and production. This way you can always guarantee your testing team leader will be satisfied or you can guarantee a no-white-screen-of-death pages in your application.
6. Plugins: are great addons to Rails while Cake is still laking community, but I think it will sooner attract more developer and I think the white page in Cake PHP's site will one day have some text
7. Caching: caching is supported in both of them.
8. IDE: Ruby on Rails has now many some nice IDE's, they're already MVC ready, while PHP is still laking a good IDE , I still see only Zend Studio offering some real power of an IDE
Conclusion
Choosing the web development framework one should bare in mind that it is simply a delivery mechanism. Whilst there are many proponents and opponents of certain style of development linked to a framework this in most cases is a matter of using "the right tool for the job". Just like a heated debate on the benefits of using Java vs .NET many would take sides and hail only one of the frameworks worthy of diving into and learning. From my point of view, all have their merits and the choice should be based on the rationale and demands of the project.
Workshop 7
While the Rails expert or aficionado may be perfectly happy with his or her RoR application, some users might be less than thrilled with some Rails hosting environments. A good Rails host will provide Shell/SSH access, Fast CGI, SCGI and/or Mongrel support, the latest RoR releases, knowledgeable support staff with Rails documentation on board, and scalability options to meet future growth.
Workshop 8
4. List what improvements could be made to the Ruby on Rails workshop series:
Workshop 7
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/
While the Rails expert or aficionado may be perfectly happy with his or her RoR application, some users might be less than thrilled with some Rails hosting environments. A good Rails host will provide Shell/SSH access, Fast CGI, SCGI and/or Mongrel support, the latest RoR releases, knowledgeable support staff with Rails documentation on board, and scalability options to meet future growth.
The following link provides access to a website with 10 best (according to the author) RoR hosting solutions with a short blurb about the features and prices:
Rails is a particularly good match for cloud computing because of its share-nothing architecture. You can toss off new instances of an application and it will just being to run. It has less to do with Ruby itself, but more to do with smart architectural decisions.Ruby is known as having a high developer productivity rate and that's always good for business. And the cloud helps most business concerns about scaling. On of the most prominent cloud service providers for RoR is Engine Yard. Engine Yard Cloud provides 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.
Workshop 8
1. List what you consider to be the three strengths of Ruby on Rails workshop series
The strengths of the workshops in no particular order would be:
- The ability to learn (or to scratch the surface in my case) the object oriented programming methodologies incorporated in an open source solution.
- Leveraging programming, database development and web development technologies all in one series.
- Experience in open source programming language/framework (most environments rely on closed sourced tools e.g. .NET)
2. List what you consider to be the three weaknesses of Ruby on Rails workshop series:
The weaknesses I can point out are as follows:
- Incoherent structure (I personally prefer to rely on textbook rather then a series of instructions in individual workshops).
- Would be nice to try other frameworks (I cannot envisage to become proficient in Ruby during one semester only) therefore an overview of other frameworks would be of great benefit.
- Initial setup until watched a video on YouTube and visited a few websites.
4. List what improvements could be made to the Ruby on Rails workshop series:
- More emphasis on other frameworks and the differences/similarities between them
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?
- The overall experience was positive and interesting. Was it effective? I am not sure as in the future I am not planning to continue down the path of Ruby development, however, it was good to look at other realms of IT (especially that Ruby seemed to have become all the rage now as far as web development goes).
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.
- I did not get the feeling that the two teams had any preferences as to which collaborative tools to use. As far as the wikis as a collaboration tool I thought that forum was more effective mean of communication between individual fellow students.
Further comments to add:
- Thank you for putting an exciting subject curriculum together and all students for cooperation and friendship.