Friday, April 16, 2010

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
Heroku Platform Architecture consists of the following 3 features:
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.from
http://heroku.com/how/architecture

Sinatra book. from http://sinatra-book.gittr.com/

No comments:

Post a Comment