18.12.2012 Views

Rails Magazine - Issue 3

Rails Magazine - Issue 3

Rails Magazine - Issue 3

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction<br />

A new generation of applications is gaining developers<br />

and users due to their beautiful look and feel and the great<br />

possibilities that they offer. We’re talking about RIA (Rich<br />

Internet Applications), a new type of software that combines<br />

the best of web and desktop applications.<br />

There are often times when we could benefit from combining<br />

the usability of the desktop with the features of a web<br />

application. Consider a program that organizes your MP3<br />

collection. Obviously, it would need to access the file system.<br />

But wouldn’t it also be nice if it could pull certain information<br />

from the internet, such as the artist’s bio and track notes?<br />

Sounds good, don't you think?<br />

Rich internet applications are more complex than normal<br />

web applications. Because of this, they’re usually developed<br />

with the aid of a framework.<br />

These days, we have many options to choose from, both<br />

open-source and proprietary. For Java developers, Open-<br />

Laszlo and to JavaFX are work a look. If you prefer Microsoft<br />

technologies, there’s Silverlight. But over the past two years,<br />

one framework in particular has grown very quickly: Adobe<br />

Flex.<br />

Flex is an open source RIA framework developed by<br />

Adobe. It allows you to build RIA applications using a n<br />

ActionScript-like programming language and a markup language<br />

called MXML for the interface. Its was initially released<br />

in 2004 and the last version is 3 which was released in March,<br />

2009.<br />

Flex has two components: an SDK (Software Development<br />

Kit) and a runtime on which applications are viewed.<br />

The SDK is open source (released under the Mozilla Public<br />

License), while the runtime is the famous Adobe Flash Player<br />

which has a proprietary license.<br />

Because the runtime is flash-based, Flex applications are<br />

cross-platform by default. And they work not only on desktops<br />

but also on many mobile devices like phones and PDAs.<br />

Moreover, the Flex SDK allows you to build software using<br />

different operating systems like GNU/Linux, MS Windows<br />

and Mac OS X since the binaries generated are cross-platform<br />

too.<br />

While you can develop Flex applications without buying<br />

anything, Adobe does offer an additional development<br />

tool called Flex Builder. It’s a modern visual IDE (Integrated<br />

Development Environment) built on top of Eclipse. Though it<br />

costs money, the Flex Builder is very useful when developing<br />

Ruby on <strong>Rails</strong> & Flex: Building a new software generation by Arturo Fernandez<br />

Ruby on <strong>Rails</strong> & Flex: Building a new software generation<br />

by Arturo Fernandez<br />

the user interface for your application.<br />

Why do we need RIA applications?<br />

A classic desktop application usually runs on a PC or Mac<br />

and it doesn't need a network connection. A good example is<br />

a word processor like Apple Pages, Microsoft Word or OpenOffice<br />

Writer. On the other hand, a web application runs on<br />

a server, and many clients simultaneously access it using web<br />

browsers.<br />

Both types of application have their own benefits and<br />

drawbacks. Obviously, they are different from a technical<br />

point of view. Desktop applications can leverage various toolkits<br />

to create rich GUIs. They’re faster. And you don’t have<br />

the rendering inconsistencies that you do with browser-based<br />

applications. Web applications, however, are easy to deploy<br />

and work on any platform.<br />

Arturo Fernandez is an entrepreneur, software<br />

engineer, technical writer and free/open software<br />

enthusiast. His professional experience includes<br />

services as software engineer, consultant, sysadmin<br />

and project manager working on technologies like<br />

J2EE, PHP and <strong>Rails</strong>. He currently lives in Andalucia,<br />

Spain where he founded BSNUX Software Factory<br />

(http://www.bsnux.com) a company specialized in RIA and<br />

mobile applications. He can be reached at arturo@bsnux.com.<br />

Technologies like AJAX bring the web a little closer to<br />

desktop-like performance, at a cost of increased complexity.<br />

Developers are forced to work in multiple languages:<br />

JavaScript for the front end and another language like Ruby<br />

for the back end. But with Flex, the you can develop an application<br />

from top to bottom in one language.<br />

Developing a RIA application we can join the best of<br />

desktop and web applications, resulting in a cross-platform<br />

application with a good and flexible look & feel that can exchange<br />

data with other applications using standard protocols<br />

and technologies through the Internet.<br />

Now let’s take a look at how we can use Adobe Flex and<br />

<strong>Rails</strong> to develop great software in less time.<br />

Front-End and Back-End<br />

A rich internet application will typically have two major<br />

components: a front-end which is the client and a back-end<br />

which contains the business logic and data.<br />

35<br />

35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!