Well i managed to download InstantRails but what i found out is that it directly impacts with WAMPServer which i was using before for the PHP and MySQLAdmin exercises. Seeing as i didn't want to uninstall WAMPServer just to get Instant Rails running, i decided to get RubyOnRails running within WAMPServer. This took a bit of time, but i eventually found a website which helped me to setup WAMPServer and RubyOnRails to work as one. http://stmogilny.wordpress.com/2008/11/24/setting-up-ruby-on-rails-with-wamp/
I have created my first RubyOnRails application through the command line, and have begun work on the online taxi system.
Responses to Challenge Questions:
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 have just moved away from the web development space of my career into business analysis, but some of the languages and frameworks i have used are as follows: C#.NET, VB.NET, PHP, Perl, Python, Javascript. In terms of web application frameworks, the main one i have used extensively is .NET 2.0, which is more than a web framework, but a whole entire development framework (for both web client apps and windows client apps)
Development framework such as .NET is there to support the developer in providing the common framework to produce applications alot easier and faster, by alleviating the need for the developer to create the most common functions most web and windows client applications need (i.e. session management, database access, security the list goes on)
Ruby on Rails i have heard of but not really had much to do with when i was working as a developer, But im really looking forward to moving into this space and to learn alot about this particular framework.
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.
At this very moment in time there are 2 categories of programming languages: one being interpreted scripted language and the other being compiled language. Ruby is an interpreted scripted language that relies on a piece of software/program which interprets the executing code in which it translates it to machine code for the computer to understand. Compiled languages such as C and C++ must be compiled into machine code before they can be executed, meaning no use for a interpreter as the running code is already readable by the machine executing it.
With both these types there are however advantages and disadvantages with each one:
Advantages of Interpreted Scripting Language
1. Platform independence
2. Can change a specific part of code without full recompilation of the code
Disadvantages of Interpreted Scripting Language
1. Slower than compiled as the code needs to be interpreted before being executed by the host machine
Advantages of Compiled Language
1. Faster than interpreted languages as the code is compiled to machine code, and no need for interpretation
Disadvantages of Compiled Language
1. Changing a specific part in code requires a full recompilation before it can be used.
Object orientated programming (OOP) is a programing paradigm that uses "objects" - data structures consisting of datafields and methods together with their interactions - to design applications and computer programs ("Wikipedia", 2010a). Ruby is a fully-fledged object orientated language as all items that you create at runtime are objects which have attributes and behaviours on which actions can be performed.
This gives Ruby really the best of both world, one being interpreted which makes it quick to update and change and machine independent. But also all the benefits of OO which has all the benefits of inheritance, encapsulation etc. This is the reason why Ruby is so powerful as its focus is on simplicity through easy to read code, but also has its roots in making development easier and faster through OO and interpreted scripting language features.
3. What is Rails and how does it work with Ruby?
Whilst i understand the .NET framework, i believe the Rails Framework to be something very similar for Ruby. According to Tatum (2003), Ruby on Rails or ROR for short is a web application framework that uses logical steps to help create workable code for the creation of websites. Ruby on Rails uses a design pattern called MVC (Model-View-Controller) to help benefit the developer by guiding them to a design pattern which is applicable to web applications. This helps the developer because they dont need to erect all the scaffolding of the application or have to completely code every aspect of their application as rails provides a blueprint of a website with all common functionality.
Basically, Rails provides the architecture of web applications from which developers can build their Ruby applications much faster and easier.
4. What is meant by “convention over configuration” in regards to the use of Rails in Web application development?
Convention over configuration 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 (Wikipedia, 2010b). This is very apparent in Rails as it enforces a naming convention that maps database table names to programming classes. An example of this is a table named Cars, then the associated class will be named Car. This means a programmer can rely on the default of naming conventions built into Rails, which inturn also speeds up development and prototyping as the developer is not wasting precious time on convention and configuration, but actual code for the web application.
5. When did Model-View-Controller begin and where is it used?
Model View Controller or MVC for short was invented at Xerox Parc in 1978 by Trygve Reenskaug. The first implementation of this approach was implemented in SmallTalk-80. The reason for this particular type of pattern was to solve the general problem of giving users control over their information as seen from multiple perspectives (Reenskaug, n.d). Here is a website i found about the author Trygve Reenskaug
Currently in most web applications out there MVC is the most widely used architectural pattern for a majority of the websites out on the internet and intranets of corporations.
6. Describe the steps involved with the MVC design approach.
The MVC architectural pattern is one that breaks up an application into 3 distinct parts: model, view, and controller.
Controller - The controller itself is used for handling events that either affect the model or the view.
View - The Views are for displaying all or a portion of the data to the user.
Model - The models are for maintaining data
There is a good explaination of the inner workings of the MVC pattern on eNode
References
Wikipedia (2010a) http://en.wikipedia.org/wiki/Object-oriented_programming
Malcolm Tatum (2003) http://www.wisegeek.com/what-is-ruby-on-rails.htm
Wikipedia (2010b) http://en.wikipedia.org/wiki/Convention_over_configuration
Reenskaug (n.d.) http://heim.ifi.uio.no/~trygver/index.html
No comments:
Post a Comment