Nitro (web framework)
Encyclopedia
Nitro was a Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

-based web application framework
Web application framework
A web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development...

 created by George Moschovitis. Nitro featured a powerful template system with a configurable pipeline of transformation steps. It was licensed under a 3-clause BSD license.

A key philosophy of Nitro was that it did not dictate how a web application should be structured. One could use templates with embedded code, as is typical with PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 or ASP
Active Server Pages
Active Server Pages , also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically-generated Web pages. Initially released as an add-on to Internet Information Services via the Windows NT 4.0 Option Pack Active Server Pages (ASP), also known as Classic...

, or one could use the model-view-controller
Model-view-controller
Model–view–controller is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" from the user interface , permitting independent development, testing and maintenance of each .Model View Controller...

 approach, as found in for instance Ruby on Rails
Ruby on Rails
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.-History:...

, or expand even further with a custom architectural pattern.

Nitro featured support for Ajax
Ajax (programming)
Ajax is a group of interrelated web development methods used on the client-side to create asynchronous web applications...

, XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

, web services and syndication while staying standards compliant.

One of its key distinctions from other similar frameworks was its use of "Og" as the object-relational database mapping layer. Og could create database tables based on Ruby classes, or it could be easily adapted to use an existing database schema.

Og

The persistence framework developed together with Nitro was named Og, short for ObjectGraph. It was an object-relational mapping
Object-relational mapping
Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language...

 (ORM) system that allowed for storage and retrieval of Ruby objects from a backend store. This could be an RDBMS, but did not necessarily have to be so. A backend adapter had been developed that stored objects in individual YAML
YAML
YAML is a human-readable data serialization format that takes concepts from programming languages such as C, Perl, and Python, and ideas from XML and the data format of electronic mail . YAML was first proposed by Clark Evans in 2001, who designed it together with Ingy döt Net and Oren Ben-Kiki...

 files on the filesystem.

Og would infer the database structure from the definition of classes that were managed by it. Database tables would be created by Og as necessary. This was different from the ActiveRecord approach used in Rails
Ruby on Rails
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.-History:...

 where the developer is responsible for creating the database tables. Og could adapt the database schema to simple changes in the class definition, such as adding or removing attributes. This feature was best turned off in a production environment. More involved changes might have required manual intervention, one could also simply remove the affected tables and let Og recreate them.

Og could be made to work with an existing (legacy) schema, by supplying hints as to which column is used to store a particular property, and which property is considered the primary key.

Hello world


require "nitro"
class MyController
def index
"Hello from nitro!"
end
end
Nitro.start MyController

Select day

This example demonstrates morphers, one of the available transformations for templates. This would result in a dropdown list containing the numbers 1 to 31, with the current day selected.




Current status
Currently the development of this framework seems to have been abandoned, and the official website has been taken down. In 2009, it was announced that development of Nitro in the Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

 had been halted, since the primary contributor George Moschovitis had moved to development of Nitro under JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

. Enthusiast were pointed to other Ruby framework projects, such as Ramaze
Ramaze
Ramaze is a web application framework created by Michael Fellinger for Ruby. The philosophy of Ramaze is a mix of KISS and POLS, trying to make complex things simple and impossible things possible....

.
External links
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK