Friday, April 16, 2010
Sinatra step 5
· Created an account in Heroku
· Installed the Heroku gem with the following line:
gem install heroku
· Created a Rackup file called config.ru. The content of this file is as follow:
require 'app'
run Sinatra::Application
· Initialized the repository with
git init
git add .
git commit -m "sinatra and heroku"
· Set up the key pair by typing
ssh-keygen
ssh-keygen -t dsa
· Created my application on Heroku by typing
heroku create
· After that I have entered my heroku credentials (email and password)
· Pushed the code with
git push heroku master
· The application was deployed on Heroku
Sinatra step 8
What is Git? Why is it useful?
Answer:
Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.
Factors that make Git useful:
· Strong support to the liner development
· Distributed development
· Compatibility with existing systems/protocols
· Efficient handling of large projects
· Toolkit-based design
· Periodic explicit object packing
· Garbage accumulates unless collected
· Pluggable merge strategies
Reference:
Git(1) manul page(n.d) Retrieved on 14th April 2010, from http://www.kernel.org/pub/software/scm/git/docs/
Describe how Sinatra relates to Ruby on Rails.
Answer:
Sinatra is not a MVC (Model view controller) based framework for creating websites, its very different than Ruby on Rails. If user wants helper functions that can help to create forms, connect the database or any other many functions that Rails can provide, user will not find it. Sinatra is a very simple and very powerful for the Domain Specific Language (DSL) for defining HTTP actions, and then sees the application’s response. However, Rails requires a different separate routes file to define the web application and to see respond to requests, which connect to the suitable controllers/models. Sinatra identify the simple thing that could work when user declare a new “get” or “post” action, Sinatra will add the route automatically and will start responding to requests that match.
Reference:
Rob Evans (24th October 2007) Sinatra, a Ruby web framework, and Why it Matters, Retrieved on 14th April 2010, from
http://deadprogrammersociety.blogspot.com/2007/10/sinatra-ruby-web-framework-and-why-it.html
C. What is Heroku? What is a Heroku “Dyno”? Describe how Heroku makes deployment and scaling of Ruby web applications easy.
if anyone needs to deploy and run application using Git, one should use heroku because heroku is an ruby platform. heroku "Dyno" are single process which run our ruby on the heroku server. heroku Dyno are based on THIN. THIN are ruby we servers which is composed of 3 best ruby libraries in web history.
- The Mongrel parser, the root of Mongrel speed and security
- Event Machine, a network I/O library with extremely high scalability, performance and stability
- Rack, a minimal interface between webservers and Ruby frameworks
Multi-Tenant: This means a single instance of application on the server serves various or multiple number of clients. We don’t need our own server as well.
Fully managed: There is a huge number of different servers within Heroku which are fully managed by Heroku themselves giving as a clean and easy interface to deploy our code.
Curation: Each layers of Heroku architecture is maintained and updated hence providing us a better and latest platform.
These features make heroku makes deployment and scaling of Ruby web applications easy.
D. Inspect the Hello World application “app.rb” file. Answer these questions:
What is the purpose of the “/param/:name” method?
Basically /param/:name is an url address .
Like http://warm-sunset-72.heroku.com/param/abhishek
here :name = abhishek
so :name is a parameter that we pass through url.
What happens when the user navigates to the /home page?
Wen the user navigates to /home
(http://warm-sunset-72.heroku.com/home)
the browser redirects the page to the index or main page of the application, which is
http://warm-sunset-72.heroku.com/
in the application we have deployed in heroku.
What is the purpose of the :set directive?
set is used to store a piece of information which can be used in our routes.
Reference:
About Git. from http://git-scm.com/about
Heroku.fromhttp://heroku.com/how/architecture
Sinatra book. from http://sinatra-book.gittr.com/
exercise 1
exercise 2

as it applies to developing a Web application. How is it related to agile development?
The approach that easy adaptable and extensible working model of a suggested system, not essential representative of the complete system, which provides users of the application with a physical representation of main parts of the system before implementation is called Evolutionary Rapid Prototype Approach.
Here ten steps mention which describe the Rapid Evolutionary Prototyping Approach according to (Phillips, 1998)
(1) Developers begin with a plan which should include an initial specification and a management strategy.
(2) From the plan derived a rapid analysis which serves to identify the first increment to be prototyped. Ideally this will be the highest-risk element of the system, which allows developers to get the most initial leverage from the user’s interaction with the prototype.
(3) Database creation for developing a database of simulated user data for the system to operate on
(4) Menus or interaction modes are developed to allow the user to interact with the data
(5) Attach the databases, menus, and interaction modes to some initial functionality.
(6) Initial prototype is completed and can be put into iteratively development cycle which involves user feedback and a repeat of steps (2) through (5)
(7) User accepted prototype is completed
(8) Design can be derived from the prototype for the finished system
(9) The final design is tuned to provide the required level of performance and become a final system
(10) System goes into operation and maintenance phase
Agile development related to Rapid Prototype Approach using minimum features that can very simple and very clear to understand to everyone. For step up and changes in features are always open in every development cycle by accepting all updates on time of different user’s requirements. This approach is really evolutionary approach to the Agile software development because it help to minimize the cost and time and meets the need of stakeholders.
References:
Connell, J.L. & Shafer, L. 1989. Structured Rapid Prototyping: An Evolutioary Approach to Software Development. Yourdon Press Computing Series.
Phillips, Greg, (1998) Evolutionary Rapid Prototyping. Retrieved 2nd April 2010, from http://phillips.rmc.ca/courses/493-1998/lectures/rapid-prototyping/rapid-prototyping.html
Image Retrieved 2nd April 2010, from:
http://www.stsc.hill.af.mil/crosstalk/1994/11/Automate_fig2.gif