What you should know about R on R and AJAX.I Wrote this article because it has become evident that there is a huge gap between the knows and the know-nots when it comes to Ruby, Rails and AJAX (Asynchronus Javascript and XML XML in full Extensible Markup Language. Markup language developed to be a simplified and more structural version of SGML. It incorporates features of HTML (e.g., hypertext linking), but is designed to overcome some of HTML's limitations. ). This article provides a cursory look at three of today's hottest web development terms. If you're an active member (or lurker lurker - lurking ) of any web development forums or newsgroups This is a list of newsgroups that are significant for their popularity or their position in Usenet history. As of October 2002, there are about 100,000 Usenet newsgroups, of which approximately a fifth are active. (or perhaps an avid Site5 Engineering Team fan), you have run into someone talking about Ruby on Rails-either to tout it as the greatest thing since sliced bread Since Sliced Bread is an online contest sponsored by SEIU. People are asked to submit their best new economic idea to help working families. Of the thousands of ideas that are submitted, 21 will be chosen as finalists. , to denounce it as a trendy and over-hyped technology, or, more likely, to ask what the heck it is and why people are so crazy about it. If you've previously glanced over these messages with the suspicion that their subject was of no interest to you and your work, chances are you were wrong. But fear not-In this article I'll give you the elevator speech explanation of Ruby on Rails See Ruby. and XML">AJAX. If this is the first time you've ever heard the term "Ruby on Rails," resist the urge to move on to the next article in an attempt to save yourself from reading about yet another impractical web technology. So, here's the rundown Rundown A summary of the amount and prices of a serial bond issue that is still available for purchase. rundown A list of available bonds in a municipal issue of serial bonds. : 1) Ruby (Just "Ruby" by itself-not "Ruby on Rails") is a programming language just like Perl, Python Python, in Greek mythology Python, in Greek mythology, a huge serpent. In some myths the infant Apollo slew Python at the oracle of Gaea in Delphi; in others Apollo killed the serpent in order to claim the oracle for himself. or PHP (PHP Hypertext Preprocessor) A scripting language used to create dynamic Web pages. With syntax from C, Java and Perl, PHP code is embedded within HTML pages for server side execution. . That's it. It's just another programming language. Albeit many Ruby programmers believe that the language has a more elegant and powerful syntax than its competitors, but when people talk about Ruby, they're simply referring to a programming language that somewhat resembles a cross between Perl and Python. If you'd like to learn the Ruby language with the help of a couple of cartoon foxes, head on over to this site 2) Rails (sometimes referred to as "Ruby on Rails") is a web application framework written in the Ruby programming language. If you're writing a Rails-based application, you're writing Ruby code. What the heck is a web application framework? That's a rather complex question, but in very simple terms, a framework is like the "support structure" of a program. Believe it or not, the majority of the time that programmers spend writing big web applications isn't actually spent on the specifics of the program's functionality, but instead it's spent doing much more general programming-writing reusable pieces of code that can be called throughout the main application. These reusable components are collectively referred to as the program's framework. Good frameworks make it much easier to add, update and modify parts of an application that do similar tasks. For instance, a very common operation in web-based programming is querying an SQL SQL in full Structured Query Language. Computer programming language used for retrieving records or parts of records in databases and performing various calculations before displaying the results. database and returning the results in a way that is meaningful to the rest of the program. The Rails framework includes a high-powered database access library called ActiveRecord that simplifies the process of using SQL databases from within an application. A few other common tasks for which Rails provides pre-written libraries include: form data validation In computer science, data validation is the process of ensuring that a program operates on clean, correct and useful data. It uses routines, often called validation rules, that check for correctness or meaningfulness of data that are input to the system. , application templates, email sending and receiving, date and time formatting and manipulation, session and cookie management, and interactive client-side functionality in web pages with XML">AJAX (read on to see what that means). The Rails framework, while flexible enough to be used by virtually any kind of web (or even non-web) application, was actually born out of another programming project. DavidHeinemeierHansson the lead programmer A lead programmer is a software engineer in charge of one or more software projects. Alternative titles include Development Lead, Technical Lead, Senior Software Engineer, Software Design Engineer Lead (SDE Lead), Software Manager for 37 signals, wrote the Rails framework to help him develop three web applications that the company develops: Basecamp, Backpack and Ta-da List. David very generously made the decision to open- source the framework, and has served as the project's maintainer since doing so. Rails has been featured on the popular technology news site Slashdot as well as technology publisher O'Reilly's website (who, by the way, have recently released a Rails book. The consequence of starting with a complete framework like Rails is that web application programmers can develop web applications much faster than if they were starting from scratch. The marketing for Rails claims that it lets you develop ten times faster than a programmer sans Rails. To really understand the power that Rails gives programmers, you should watch the Rails video, which shows a Rails application being built from scratch in 15 minutes! 3) AJAX, or Asynchronus Javascript and XML, is not a single technology, but rather a methodology of using a combination of Javascript, the Document Object Model (DOM), and the XMI (1) (XML Metadata Interchange) An XML-based representation of a UML model. XMI is used to transfer UML diagrams between various modeling tools. See UML. (2) An earlier high-speed bus from Digital that was used in large VAX machines. ,\Http Request feature of modern browsers to make requests to the remote ser,ver and conditionally update page content between browser reloads. Clear as mud, huh? I'll go over it piece by piece. One of the problems faced by web application programmers is that there really isn't a way to provide a true "interface" in the sense that we're used to with desktop applications. With a web application, the interface is actually a series of individual requests made to a web server. Without the use of cookies and special trickery Trickery See also Cunning, Deceit, Humbuggery. Bunsby, Captain Jack trapped into marriage by landlady. [Br. Lit.: Dombey and Son] Camacho cheated of bride after lavish wedding preparations. [Span. Lit. by programmers, the web server wouldn't have any way to determine if two requests were made by the same person, or by two different people. Imagine having to include your username The name you use to identify yourself when logging into a computer system or online service. Both a username (user ID) and a password are required. In an Internet e-mail address, the username is the left part before the @ sign. For example, KARENB is the username in karenb@mycompany. and password on every single page of the Amazon.com website if you wanted it to "remember" your name, preferences and 1-click settings-pretty irritating to say the least. So in order to solve this problem, application developers invented several techniques for storing user information and program data between page requests. Now web developers are going a step further. Rather than wait for the next full page request to update the page, through the use of a Java.script function known as XML\HttpRequest, web application programmers are making calls to the remote server from within a web page. By a "full page request," I'm referring to what happens when you click on a link or type a URL URL in full Uniform Resource Locator Address of a resource on the Internet. The resource can be any type of file stored on a server, such as a Web page, a text file, a graphics file, or an application program. in your browser's address bar: the whole browser content area reloads with the new page. That's how the web works-the new page replaces the old one (although it may be made to took like the previous page in order to give the impression that you haven't left the site you're on). However a page using AJAX techniques will use Javascript code embedded in the page to make a request "asynchronously" (basically "in the background") to the remote server and receive a response without your browser page reloading Reloading A term lenders commonly use to refer to the habits of borrowers taking out loans to repay the balance on other loans. Often reloading is done to take advantage of lower interest rates offered by other loans, and potential tax benefits. . One simple use of this technique is to have a text box to make repeated calls to the remote server as you type, and display the results in what appears to be a "drop down" menu below the text box. If you've ever used the email address See Internet address. book or the new Google Suggest search tool (try it at http://www, google.com/webhp?complete=l) you'll see how handy just a pinch of AJAX functionality can be. If you want to see the mother of all AJAX tools, take a look at Google Maps Google Maps (for a time named Google Local) is a free web mapping service application and technology provided by Google that powers many map-based services including the Google Maps website, Google Ride Finder and embedded maps on third-party websites via the Google Maps (maps. google.com) and notice how the map seems to change without your browser reloading the page. That's AJAX at its finest. Now why does this matter if we're talking about Ruby on Rails-a server side (as in, the code is ran by the web server, not the web browser The program that serves as your front end to the Web on the Internet. In order to view a site, you type its address (URL) into the browser's Location field; for example, www.computerlanguage.com, and the home page of that site is downloaded to you. ) programming language and framework? Rails happens to include an extensive library of AJAX functions that can be used without any Javascript knowledge. You use Rails functions from Ruby scripts and Ruby templates (which look very similar to PHP pages) and those functions automatically generate the Javascript that performs the AJAX magic. So by learning Ruby on Rails, you're gaining the ability to use some very advanced Javascript techniques. A pretty nice deal!!! The bottom line is that Rails is quickly sweeping through web development communities and converting many former zealots Zealots (zĕl`əts), Jewish faction traced back to the revolt of the Maccabees (2d cent. B.C.). The name was first recorded by the Jewish historian Josephus as a designation for the Jewish resistance fighters of the war of A.D. 66–73. of other programming languages. Rails is too new to have many large-scale commercial applications that you can go out and drop into your website right away. However the first generation of viable Rails replacements for common programs (forums, blogs, CMS (1) See content management system and color management system. (2) (Conversational Monitor System) Software that provides interactive communications for IBM's VM operating system. systems, etc.) should be ready within the next three months. Meanwhile, web developers who are eager to try Rails programming are begging their hosts to provide support for Rails-based sites (something that we completed support for here at Site5 just earlier this week). Over the next few months, expect to see announcements from many hosts and control panel systems boasting support for Ruby on Rails. There is no doubt that Rails will be a fixture in the web development community for many years to come, and will give the established applications and programming languages an impressive run for their money. Keep an eye out for this next-generation platform--or better yet, beat the masses and get started developing your own Rails-based site today! Additional Resources: * Ruby on Rails official website: http:/www.rubyonrails.org * Ruby language official website: http:://www.ruby-lang.org * An introduction to AJAX:http://www.adaptivepath.com/publications/essays/archives/000385.php http://wiki.rubyonrails.com/raits/pages/StartAtTheBeginning |
|
||||||||||||||||

Printer friendly
Cite/link
Email
Feedback
Reader Opinion