Ph: 108563071
YOUR FEEDBACK
Anson Bell at Chelsea Piers
Anson Bell wrote: Who owns the Anson Bell?
Did you read today's front page stories & breaking news?

AJAXWorld RIA Conference
$300 Savings Expire July 25
Register Today and SAVE!
[image]
2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts
[image]
2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
[image]

TOP THREE LINKS YOU MUST CLICK ON


Why Ruby on Rails Has Become a Popular "Next Platform"
A RoR Primer for Java Developers
Digg This!
[image] [image] [image] [image] [image] [image]
Page 1 of 2   next page »

In a very short time Ruby on Rails has gained popularity in the enterprise development community among both programmers and system managers. As an open source platform, Ruby is proving to offer a number of advantages for powering enterprise applications, not the least of which is a shorter development time for robust applications and the creation of denser code that's easy to work with and maintain. This article is offered as an introduction to Ruby on Rails for Java developers, offering some basic insight into the evolution of Ruby and Rails and its expanding role in enterprise application development.

The Ruby Language
Ruby was born as an open source programming language on February 24, 1993 and was publicly announced to the world in 1995. Ruby's primary author is Yukihiro "Matz" Matzumoto. Like Perl or Python, Ruby is an interpreted dynamically typed object-oriented programming language. While Java was growing at breakneck speed in the 1990s as a commercial development platform, Ruby remained a more or less academic project. Since many of its language constructs were adopted from Smalltalk, many of Ruby's initial followers were Smalltalkers and language aficionados. These early adopters had a strong cultural influence on Ruby, largely in the promotion of agile development practices for Ruby projects.

Enter Ruby on Rails
Ruby started to see a rapid rise in visibility and popularity shortly after July of 2004 when David Heinemeier Hansson released his first version of Ruby on Rails. Rails was created as a framework to create database-backed Web applications. The first application built with the new framework was a Web-based project management tool called Basecamp.

Relatively speaking Ruby is very new to the Web development space compared to competing languages. Ruby on Rails came on the scene around the time PHP was gaining ground as a standard for building small to medium-sized Web applications.

The Ruby on Rails stack is similar to Struts, WebWork, or CakePHP in using a Model/View/Controller (MVC) abstraction. Many of the early adopters of Ruby on Rails who weren't already in the Ruby community when Rails was released came from the PHP or Java worlds. The PHPers were drawn to Ruby on Rails to escape the lack of structure and the time spent developing custom standards for each application. And the Javanese were attracted because of what is often seen as the bloat and friction of the existing Java frameworks and their components. Ruby on Rails is a complete solution and avoids many of the hang-ups in other development platforms by applying a default set of standard practices to a new project and seamlessly integrating all of the subcomponents behind the scenes to provide a uniform interface to the developer.

Since Rails is a threat to existing institutions in the Web application space, it's been accused of being unfit for large deployments, or anything other than building blogs. As a developer who has applied Rails to e-commerce, social networking, distributed computing, and data reporting, among other domains, and made them scale, I can say with confidence that these claims are far from credible. Increasingly large sites such as NASCAR Community, Twitter, and Funny or Die are choosing to use Rails and are undeniably demonstrating Rails' readiness for prime time. Practical experience proves that Rails is highly scalable and can handle millions of users or transactions.

How Does It Work?
Rails can be broken down into two core libraries: ActiveRecord and ActionPack. ActiveRecord is an object/relational mapping (ORM) library similar to Hibernate. ActionPack encapsulates the core controller stack (ActionController) as well as a view level template engine (ActionView/ERb). A standard Rails installation includes several tools to automate a broad spectrum of common tasks as well.

One significant cultural difference between the Java frameworks and Ruby on Rails can be seen in the Rails mantra: "Convention over configuration." Every Java developer has had to endure the pain of maintaining the seemingly endless XML files that plague their projects. Rails absorbs much of this by setting forth basic conventions for file, database table, and column naming as well as directory structure. The intention of this shift is to let developers focus on the real problems, which don't include "What should we name the directory where X files are in?" or "Should ids be <tablename>_id or just id?"

Another cultural difference is exemplified by another common phrase in the Rails community - DRY up your code. DRY is the acronym for "Don't Repeat Yourself." Similar Java implementations make it very difficult to make changes. The Java and .NET solutions tend to work around this problem by building tools for the purpose of "refactoring" or renaming a definition that has references all over the place. Because so many implementation details are implied from a master source, making changes in Rails becomes straightforward and generally requires a change at a single location.

Models
The Ruby on Rails model layer is provided by ActiveRecord (AR). ActiveRecord is an ORM library in the same vein as Hibernate or TopLink. ActiveRecord objects represent individual records from a database table. Defining an AR class is very simple and much of the configuration is hidden behind default conventions:

class Page < ActiveRecord::Base
end

Compare this to an equivalent Hibernate definition:

/**
* @hibernate.class table="miners"
*/
public class Miner {
    private Long id;

    ... more column vars ...

    /**
    * @hibernate.id generator-class="native"
    */
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    ... more column getters and setters ...

}

The first difference that you will notice is that there is no configuration or mention of column names in the ActiveRecord implementation. This code fragment will reference the pages table, and will have its getters and setters automatically generated. The attributes for an instance of the class are inferred from the database, as are their types. Most of these default conventions can be overridden if needed but otherwise the naming conventions provide Rails with enough information to get out of the way and let you solve the real problems at hand. The only configuration that is needed is used to set up the initial database connection; the database.yml:

development:
   adapter: mysql
   database: application_development
   username: application
   password: password
   host: localhost



Page 1 of 2   next page »
[image] [image] [image] [image] [image] [image]
About Ryan Garver
Ryan Garver is CTO of ELC Technologies, a software-consulting firm based in Santa Barbara, California, that has the biggest team of Ruby on Rails developers bringing new applications to global 2000 companies and startups. He holds an MS in computer cience from the University of California, Santa Barbara.

YOUR FEEDBACK
Why Ruby on Rails Has Become a Popular "Next Platform"
Is JDJ Fading Out? wrote: How did the JDJ let this article slip into the magazine this month? Ruby on Rails is still all hype. Code Monkeys BEWARE! And frankly I would stay away from Grails, too. Try decompiling the resulting Java code, and any true Object Oriented Programmer will probably lose his/her lunch. If this keeps up, I am discontinuing my subscription.
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
Anonymous Java Addict wrote: In response to : "Rails on its own is not thread-safe so parallelism must be found at the process level by running multiple application server processes." ... Seriously, who really wants thread-safety these days anyway? :)
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
Same Old Same Old wrote: I really think it's hilarious when someone writes an article about "Ruby on Rails" and think it's the best thing since sliced bread. I've been doing Struts since 1990 and, it's pretty darn good. And, lots of developers know it, you can get "good help" when you're "good" programmer goes awol, and, now there's more important things to consider in the "web development space" at now than the back end stuff. Also, great line about "...large sites such as NASCAR Community, Twitter, and Funny or Die are choosing to use Rails and are undeniably demonstrating Rails' readiness for prime time." Come on, large sites??!!! Were you born in 1990?
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
Randal L. Schwartz wrote: Look at the Seaside Smalltalk framework as well. See http://seaside.st/ and note that it's about 10x as efficient for the same hardware, even before tuning, than RubyOnRails.
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
casp1 wrote: What about groovy on grails - enhanced ruby and simplified Java - must be the next topic...
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
Ze'ev wrote: I would recommend looking at [htt p://www.python.org/about/ Python] and [http://djangoproject.com Django] as alternatives to the hyped RoR. I find Python much more readable dynamic programming language. Moreover, Python has a very big and loyal community and a enormous collection of open source libraries and frameworks. Django is a web framework written in Python that has many of the features of RoR and more.
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
Brian Mulroney wrote: God, yet another Ruby evangelist blowing his horn. Blah, blah, blah...Ruby is wonderful..Ruby is better than everything else.. ROR is the future and there's nothing else as wonderful. We've heard it all a million times on every blog and forum. Give us a break.
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
grid4reason wrote: The world is moving towards dynamic programming languages, so the question is really a matter of which dynamic programming language will win out. Python? Ruby? Perl 6? My bet is on Ruby.
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
an0n wrote: If/when RoR breaks into mainstream I'll be very surprised.
read & respond »
Why Ruby on Rails Has Become a Popular "Next Platform"
Web Frameworks wrote: If you like PHP and think Ruby on Rails or any other MVC framework is what you're into, you might want to check out a pretty cool and full featured MVC framework for PHP called Mojavi. It's here: http://mojavi.org].
read & respond »
LATEST JAVA STORIES & POSTS
What Does the Future Hold for the Java Language?
[image]Before Java I was a Smalltalk guy. I remember switching from one language to the other and the tipping point that you reach when you've mastered the new language and how many months it takes, not to mention the years, to do really good design and know-how, which patterns to apply
Adobe's Kevin Lynch and Microsoft's Scott Guthrie to Keynote AJAX World RIA Conference & Expo
[image]Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted
Rating JRuby, Jython, and Groovy on the Java Platform
[image]Open source software, while not synonymous with Java, may often be seamlessly integrated with Java code to produce a versatile synthesis that makes developers' lives much easier. In recent years, developers have taken some open source dynamic languages, commonly referred to as 's
JMSL Numerical Library for Java Applications
The JMSL Numerical Library is the broadest collection of mathematical, statistical, financial, data mining and charting classes in 100% Java. It is the only Java programming solution that combines integrated charting with the reliable mathematical and statistical functionality of
Cloud Computing - IBM's Got Its Head in the Clouds
[image]Reminding people of how its backing was the making of Linux, IBM, to no one's surprise, has thrown its support behind cloud computing, that delicious nexus of every chi-chi buzzword technology currently in vogue: Web 2.0, rich Internet applications, software-as-a-service, SOA, gr
The Right Time for Real Time Java
[image]Faced with the demands of mission-critical applications, many enterprise developers have pushed the Java language and the Java Virtual Machine (JVM) to the limit. The most common issue seen in transactional environments is achieving predictable response time or latency - in other
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
[ http://www2.sys-con.com/newslettersub.cfm ]
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
[image] Click to Add our RSS Feeds to the Service of Your Choice:
[image] Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
[image] myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021
[ http://view.atdmt.com/MRT/iview/108563071/direct/01?click= ]

SYS-CON FEATURED WHITEPAPERS
MOST READ THIS WEEK
Appcelerator Building Out the RIA Open Source Community
Third Brigade Nominated for SYS-CON's "Virtualization Journal Readers' Choice Awards"
Elixir Technology (Represented by JNet Direct) Nominated for SYS-CON's "SOA World Magazine Readers' Choice Awards"
eG Innovations Nominated for SYS-CON's "Virtualization Journal Readers' Choice Awards"
XP Forced into Semi-Retirement
Building RIAs Using Microsoft Silverlight 2
Wyse Technology Nominated for SYS-CON's "Virtualization Journal Readers' Choice Awards"
Vyatta Nominated for SYS-CON's "Virtualization Journal Readers' Choice Awards"
Seagull Software Nominated for SYS-CON's "SOA World Magazine Readers' Choice Awards"
Why the Web Dinosaurs Died
iTKO LISA Nominated for SYS-CON's "SOA World Magazine Readers' Choice Awards"
IONA Nominated for SYS-CON's "SOA World Magazine Readers' Choice Awards"
SPONSORED BY INFRAGISTICS
SOA in a JVM: OSGi Service Platform - A Dynamic Component System for Java
There are many forces that influence technological evolution. After a decade of building enterprise
AJAX and Enterprise RIA Tools - JSF, Flex, and JavaFX
2008 is going to be an important year for Rich Internet Applications. Most organizations are deliver
Final Voting Phase on OpenAjax Browser Wishlist
The OpenAjax Alliance is developing an Ajax industry wishlist for future browsers, using a dedicated
AJAX World RIA Conference News - Netflix UI Guru To Present on Crafting Rich Web Interfaces
In every field of design one of the first things students do is learn from the work of others. They
Infragistics Releases CTP UI Components for Microsoft Silverlight Beta 2
Infragistics announced the availability of two Community Technology Preview (CTP) User Interface (UI
Yahoo User Interface 2.5.2 Released
The YUI development team has released version 2.5.2; you can download the new release from SourceFor
ADS BY GOOGLE
BREAKING JAVA NEWS
GSS Migration Toolkit for Sun Communications Suite Enables Migration from IBM Lotus Notes and Domino to Web 2.0 and SaaS
Global System Services Corporation (GSS) today announced the GSS Migration Toolkit for Sun J
[ http://banners.sys-con.com/phpAdsNew-2.0/adframe.php?n=afde3425
close this window


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser