Ajax On Rails 235
mu-sly writes "Ajax and Rails - probably two of the biggest buzzwords in web development at the moment. In this article over at ONLamp, Curt Hibbs introduces the incredibly powerful Ajax support that is part of the Ruby on Rails web application framework. It's a great read, and serves as a gentle introduction to the cool stuff you can accomplish with ease using the Ajax features of Rails."
Rails, great for those fed up with J2EE. (Score:5, Interesting)
Even when using newer frameworks like Spring, Tapestry and Hibernate (I hate you so much Struts) Rails still manages to be easier.
I highly suggest any developers looking for a change of pace at least give Ruby on Rails a few hours of your evening. While it's not nearly as comprehensive as Java, it's gaining libraries and functionality by leaps and bounds.
And just so I don't get labeled as a Rails fanboy/Java basher: Rails is not perfect, I still would recommend using J2EE for large corporate projects. It's just a much more mature solution with less unknowns. I think Rails needs another year at least before people are ready to really give it a shot in the corporate environment.
Re:Rails, great for those fed up with J2EE. (Score:3, Interesting)
RoR, IMHO, is a major step forward to web deployed applications becomming mainstream.
Re:Rails, great for those fed up with J2EE. (Score:2)
Re:Rails, great for those fed up with J2EE. (Score:2)
Damn right! Databases all ought to be like Oracle, where even typing in a query is a hellish quest involving obscure replacements for DNS (tnsnames), client software that's incompatible when even a minor versionnumber changes, convoluted connectstrings and non-gui client tools (un
Re:Rails, great for those fed up with J2EE. (Score:2)
Seriously, I don't know how Oracle gets away with sqlplus... Would it be *that* hard to add readline support?
Re:Rails, great for those fed up with J2EE. (Score:2)
readline is also obsolete. (Score:2)
Re:Rails, great for those fed up with J2EE. (Score:2)
Oracle's "brilliant" product for developers - Developer 2000 - involved TWO - count 'em! - TWO 800 page books on how to develop forms.
Forms which have absolutely NO WAY to be documented as to how they are constructed (other than printing out individual screens of trigger code and the like.)
One of the most pathetically incompetently designed products I've ever seen.
Anybody who uses Oracle (other than the database itself - with nothing else) is out of their minds.
Re:Rails, great for those fed up with J2EE. (Score:3, Interesting)
Our company recently tried to do a web-project (workflow management application for a publishing house) based RoR. It was a spectacular failure - LOTS of things are mostly absent from RoR: caching and transaction support, object-relational mapping is inferior (yes, ActiveRecord is NOT enough), etc.
RoR is nice, but it needs lots of polishing and some redesign. In its present state RoR can't be compared with J2EE solutions, they are far m
Re:Rails, great for those fed up with J2EE. (Score:5, Informative)
Re:Rails, great for those fed up with J2EE. (Score:2)
And Ruby's transaction support is very limited, for example it's impossible to detach record from a transaction, save it to session and then reattach this record to a new transaction (with concurrency control based on timestamps/verisons, of course). Hibernate (http://www.hibernate.org/ [hibernate.org]) supports this, BTW.
Re:Rails, great for those fed up with J2EE. (Score:4, Informative)
Re:Rails, great for those fed up with J2EE. (Score:2)
Yes, you are talking out of your ass. (Score:2)
Re:Yes, you are talking out of your ass. (Score:2)
Usualy cache coherence is ensured using distributed evictions (like in SwarmCache) or clever locking strategies (like in Coherence). Most of this can be abstracted into separate layer, but still some interaction from the host container is required.
What are you talking about? (Score:3, Informative)
Re:Rails, great for those fed up with J2EE. (Score:4, Interesting)
Ruby can't do complex things java can??? You meant rails, probably, and such confusion of terms is not a good sign.
Have you checked out the latest rails versions' API? I see transaction support and caching of db data and cgi actions too.
As for the 'inferior' object relational mapping: indeed Active record tries to keep things simple: I'm grateful for it. Rails developers got too far sometimes, as you see if you have a column named 'type' in your tables
But, that's not being inferior, it's being different. If your app requires convolute mappings, either extend active record to suit your needs or do without it (possibly dropping rails altogether and wasting precious ram with a JVM
Re:Rails, great for those fed up with J2EE. (Score:3, Interesting)
Re:Rails, great for those fed up with J2EE. (Score:2, Insightful)
The moral is, no matter how complex a system build on Ruby will get, it will always be more simple to use than a system build on Java, just because Java carries the characteristics of a systems programming language while Ruby carries the characteristics of a scripting programming language.
Re:Rails, great for those fed up with J2EE. (Score:3, Insightful)
Advantages of dynamic languages (Score:3, Insightful)
Re:Rails, great for those fed up with J2EE. (Score:2)
I'm just saying that Ruby in its current state can't really handle complex web-applications. I don't say anything about future RoR versions.
Active record tries to keep things simple, yes. But sometimes things just can't be simple: we've had lots of problems with cascaded deletes/updates, inverse mappings and bi-directional structures. Finally, we just used Active records like a plain SQL query engine with little additional benefit.
Re:Rails, great for those fed up with J2EE. (Score:2)
By saying "Ruby doesn't have ____" and being shown to be wrong? Heh.
As for being able to handle complex web apps, depends on your definition, I suppose. I'd certainly consider things like Basecamp [basecamphq.com] to be a "complex web app," but perhaps Java lets sites like that remotely read your mind using ESP or something else nifty.
Re:Rails, great for those fed up with J2EE. (Score:5, Informative)
I'm going to overlook the fact that a flexible caching mechanism has been in place since pre-snowdevil (maybe february) and transaction support was added at some point before the last time I worked with rails (late april). Keep in mind that it's still pre-1.0 and beta and not yet feature-complete. Criticizing it for a lack of features it supports, though, is in poor taste.
Furthermore, almost all rails development at this point has been executed using very small (5 people) core teams. J2EE supports large scale development because it was designed for it. Rails was designed to let a relatively small number of people write an agile application using the set of paradigms which rails was built on. Coming at it from an "I use java in the enterprise and couldn't plug rails in its place tomorrow" is a little bit unfair, because in the same sense, I couldn't just drop J2EE onto my own desktop and start developing with it tomorrow. (Not to mention that my boss would not even begin to authorize such an expenditure for one developer on one product).
I see rails more as a contender to PHP than to J2EE. J2EE and rails are not really comparable in the same market. Sure, rails beats the crap out of J2EE when you've got 1-3 developers on the project, and inversely, when there's more than 10, J2EE has a clear advantage. Coming from java, you're likely to miss many of the benefits of metaprogramming in rails. Even coming from python (a somewhat similar language to ruby), I was a bit startled at some of the techniques being used.
Your project might have failed, but I'm not sure it was completely rails that caused it. AR is very easily extensible (in a matter of hours, usually) to do all sorts of more enterprise-java-like things. Ruby's dynamic messaging and open classes makes that a much simpler affair than it would be in java. Why didn't you extend it to meet your needs? Also, how did you miss the fact that caching and transactions have been there for a while? Were you trying to shoehorn rails onto an old schema? Did you have prior ruby programming experience or were you learning as you went? Did you have prior experience in a dynamically typed language writing an app of similar complexity? Nothing is going to make the solution of a hard problem easy. Some things can make it more pleasant, if used correctly.
Re:Rails, great for those fed up with J2EE. (Score:4, Interesting)
This, I think, is the crux.
My company has a library, too, that makes certain assumptions about the DB. We're really wicked-fast when using it, when building an app from the gound up. It has hooks for overriding some assumptions, so we can shoe-horn it in to some other projects. But if the DB is hopeless, the game is over, and we have to do things like everyone else.
And nearly every company out there has a hopelessly messy DB, that can't be refactored because of X, where X is legacy apps, no money, management resistance, [...]
Hell, even Hibernate/middlegen has a problem related to this: all it takes is one clueless app developer that scorns DB constraints, and you have a Situation that can cost 10s of K to fix.
Rails is neat (I'm a pretty big perl bigot, and I like it), but it isn't designed for integration. Folks playing around with it should recognize that up front, so that they don't try to do the wrong thing with it.
Re:Rails, great for those fed up with J2EE. (Score:5, Interesting)
True, you can't just drop J2EE on your desktop because there's no such _thing_ as J2EE. J2EE is a set of standards (which contains just about everything).
The only things you need to start developing J2EE applications are: Tomcat (http://jakarta.apache.org/tomcat/index.html [apache.org]), optionally a web-framework (like http://jakarta.apache.org/tapestry/index.html [apache.org]) and you can start developing tomorrow (if you know Java of course) and a decent IDE (http://www.eclipse.org/ [eclipse.org]). It will cost you about $0.
Java has some metaprogramming featues starting from version 1.5. Right now we're writing application in C++ and Python, so I don't miss metaprogramming features
RoR is extensible, but some features are just very hard to implement: maintaning persistent object identity, complex mappings support, distributed caching and long-running transactions with optimistic locking.
We had previous expirience in dynamic languages (Python, Perl, PHP). This project was a sort of expirement - we wanted to see what can be done with RoR.
Re:Rails, great for those fed up with J2EE. (Score:3, Insightful)
You forgot the "learn J2EE" part, which is going to be a task at least a magnitude more complex than learning Java itself.
Re:Rails, great for those fed up with J2EE. (Score:3, Insightful)
Rails itself could be put on top of any persistence layer. Instiki uses Madeliene instead of AR and it works fine. It just comes, o
Re:Rails, great for those fed up with J2EE. (Score:2)
workflow, caching, object based database, transaction, etc. I don't know if it's easier than Java, but it's easy enough for me.
Re:Rails, great for those fed up with J2EE. (Score:2)
Re:Rails, great for those fed up with J2EE. (Score:2, Informative)
yes
> Until you try to do something even moderately complex.
nothing is easy when it's complex
> caching
nope, its there
> transaction support
yep it's weak.
> object-relational mapping is inferior
Isn't any OR mapper slow/bloated and really just a starting point?
> RoR is nice
yes
> but it needs lots of polishing and some redesign.
it's not 1.0 yet
> In its present state RoR can't be compared with J2EE solutions, they are far more powerfull and _flexible_.
I don
No, you hold the hype for 3 months. (Score:5, Insightful)
Re:Rails, great for those fed up with J2EE. (Score:2)
I guess what I really want is a Java equivalent of Rails. Java On Crutches or something like it.
P.S. Slashdot just said:
Fucktards.
Re:Rails, great for those fed up with J2EE. (Score:2)
It uses a lot of assumptions and works best with MySQL. Once you start using it with a legacy database and start
Re:Curious (Score:2)
I've been working with struts as of late, and although setting things up can be a little tedious, what specifically don't you like about it?
Re:Rails, great for those fed up with J2EE. (Score:2)
Neither should it be to wipe out your database by setting the rake testing database to the same as you store your important data in.
Re:Rails, great for those fed up with J2EE. (Score:2)
Get real. (Score:2)
Re:Get real. (Score:2)
I suppose the 3 interviews and 2 job offers I recently got for sysadmin positions with heavy Tomcat must be an illusion.
Yeah, you're right, nobody is using it.
Read harder. (Score:2)
Substitute for s (Score:2, Interesting)
Re:Substitute for s (Score:2)
BTW I recommend giving rails a try, it's really a well thought out environment for your web apps. The site linked in my sig is a quick and dirty powerdns + lighttpd + rails experiment on a debian UML host (still on 2.4)
Ruby on Rails as a threat to PHP? (Score:5, Insightful)
Re:Ruby on Rails as a threat to PHP? (Score:2)
And what transition would that be, excatly? PHP5 is almost completely back-compatible with PHP4.
Re:Ruby on Rails as a threat to PHP? (Score:3, Interesting)
Re:Ruby on Rails as a threat to PHP? (Score:3, Funny)
Re:Ruby on Rails as a threat to PHP? (Score:2)
Also, PHP is already a larger language than perl,
having 3,000 built in functions.
And worse, it still doesn't have namespaces.
Thankfully PHP 5 actually has some decent OO features.
Rails book from the Pragmatic Bookshelf (Score:4, Informative)
Re:Rails book from the Pragmatic Bookshelf (Score:5, Informative)
I also bought Programming Ruby by the same author because I want to do more with Ruby than just Rails, but this isn't necessary for those who just need Rails - all Ruby constructs and idioms are cross-referenced with an included introduction to the language.
Extract from Web 2.0 chapter available there (Score:2)
As mentioned in Curt's great article, the Agile Web Development with Rails (beta) book has a nice chapter on Ajax support. You can even get an extract of the chapter at the pragmatic programmer's site: PDF Extract of Chap 18: Web 2.0 [pragprog.com]
Figure 18.1 should make Ajax clear. The book is highly recommended, and the 2nd Beta was just released last week.
Which is the bigger irony: (Score:4, Insightful)
b) Microsoft's own technology being used by Google to loosen Redmond's deathgrip on the market?
Re:Which is the bigger irony: (Score:3, Interesting)
This isn't quite correct. IFrame and hidden IFrame communication was invented before that. The catch is that browsers weren't stable enough or compatible enough to make use of these channels.
XMLHttpRequest does more or less the same thing as an IFrame (via an ActiveX contarol), except that it adds the over
Re:Which is the bigger irony: (Score:2)
That't a pity...
Go try it at http://www.google.com/webhp?complete=1&hl=en [google.com]
Re:Which is the bigger irony: (Score:2)
Re:Which is the bigger irony: (Score:2)
Re:Which is the bigger irony: (Score:3, Informative)
Google Suggest uses XMLHttpRequest, while Google Maps uses a iframe
Re:Which is the bigger irony: (Score:2)
No it doesn't. There is no requirement to actually request XML. Indeed many uses of it do not use XML at all. So far, none of mine use XML.
Re:Which is the bigger irony: (Score:2)
Microsoft's own technology being used by Google to loosen Redmond's deathgrip on the market
This is nothing new to Microsoft - they have long been creating tools for their own competitors. Microsoft create a platform and sell development tools for the platform. However MS is also an ISV for that same platform (e.g. MS Office). Hence there is an inherent conflict of interest - the platform side is developing and selling the tools that will be used by competitors to compete with the ISV side.
This is one o
Re:Which is the bigger irony: (Score:2)
Re:Which is the bigger irony: (Score:2)
Dont Forget Zope (Score:4, Insightful)
On the other hand remember Zope - If you can get your head around Aqusition, the ZODB and Product Deveopment then Zope is a super-fast development platform.
Re:Dont Forget Zope (Score:3, Interesting)
I recenty became the web administrator at a small university and the college I work for uses Zope. I knew a little Zope and Python beforehand and it helped me get the job. I was all hot and heavy to switch them to a PHP/MySQL solution, though my first love is Perl. Doing stuff in PHP was fast. As I studied Zope and Python more and more I came to realize that my initial impre
Re:Dont Forget Zope (Score:2)
I said small university. I am the team.
What would you recomend?
A few of them there know Zope but not Python. Since Plone doesn't cost anything I'm not wasting their money. If Python is good enough for Google and ILM, it's good enough for me. I'm not wasting their time. They already have a history with Zope. Plone was
it's an illusion alright (Score:4, Funny)
It's illusory alright, when I start at the US and scroll due west the first thing that I come to is the UK. Where'd all the other countries go?
Re:it's an illusion alright (Score:5, Funny)
Re:it's an illusion alright (Score:2)
Wherever you threw your eyeballs I suppose. The first country to appear should be Ireland (not taking smaller islands into account).
Thomas-
Re:it's an illusion alright (Score:2)
Best to read these things closely before you start hurling around insults.
And the funny thing is... (Score:2, Insightful)
Re:And the funny thing is... (Score:2)
Um, was that actually hated by anybody? Did anybody know about it except Microsoft?
I think IE is hated for its complete lack of support for just about anything standard and less so for ITS non-standard features - especially the one nobody knew about (until it became useful.)
AJAX meme (Score:3, Informative)
http://www.realmeme.com/miner/technology/ajaxDeja
However, Ruby on Rails is clearly rising,
moving steadily upward for over a year. Thanks to a reader for bringing this to my attention.
http://www.realmeme.com/miner/technology/hibernat
Re:AJAX meme (Score:4, Informative)
There have been some critics of the term AJAX, claiming that the Adaptive Path [wikipedia.org] consultancy who created it [com.com] are using it as a marketing vehicle (and as a meme [wikipedia.org]) for previously used techniques [25hoursaday.com]
It has been pointed out that the AJAX technologies did not have a common name before, and that some welcome a unifying term for the process. However it is also reported that the Google engineers who have created the most prominent applications using this technique consider their technologies as 'Javascript'
AJAX is not a new approach of building software. From a higher perspective the presentation layer is like a form and a programming layer behind handling the events, commonly known in programming terms as MVC [wikipedia.org]. This kind of programming is very well known in older programming environments like Delphi, MFC, Visual Basic, Oracle ADF, and Windows Forms, just to name a few. Applications using this model of programming have been around for years: Microsoft Outlook Web Access using WebDAV and the Web based ERP system P2plus using web services directly from the browser. However, because there are no standards available for the communication model behind previous implementations, all use proprietary extensions.
A new aspect to AJAX is that there are now multiple browsers that can be used to realize this type of application, as opposed to earlier technologies which were frequently limited only to Microsoft's [wikipedia.org] Internet Explorer [wikipedia.org].
Re:AJAX meme (Score:2)
Rails changes the whole Web development game (Score:4, Interesting)
I've also developed a large marketing system for the restaurant industry in Rails which lets restauranteurs develop e-cards, e-gifts, and send them to their customers on certain days.. or certain days away from their birthdays, etc.. and that will be going fully live soon.
My 10,000 user strong RSS Digest [bigbold.com] will be making the leap to Rails soon (July 1st) and this is a system driving over half a million uses a day.
I developed a del.icio.us-style tagged Code Snippets [bigbold.com] site in Rails within two days! It's had further refinements since then, but less than two weeks after launch, it was getting thousands of pageviews a day and hundreds of visitors a day from Google.
I was ready to give up development work 6 months ago, and now it's the most fun and profitable work out there for me. Ruby on Rails deserves the attention it's getting. You can put together your ideas in a fraction of the time you'd have ever imagined.
Wow.. (Score:2)
Will that be 5 or 10 years experience? (Score:5, Funny)
(To all potential employeers: I kid!)
Re:Will that be 5 or 10 years experience? (Score:2)
Hell, I was doing AJAX back in my System/32 RPG II days!
(Yeah, right! Ajax cleanser, maybe...)
(As an aside, I just read some article about some major financial company trying to get away from doing RPG II programming on one of their mainframes. I'm like, WHAT? Some asshole is STILL programming in RPG II?)
Ruby? (Score:2)
I started using Ruby a long time ago, back when no one knew about it. I liked it because it was like a better Perl (better OO support but with Perl syntax). However, I quickly tired of its lackluster performance. I mean it was a lot slower than even Perl or Python. I eventually moved on hoping to return when Rudy had matured and performance was kicking. Last time I checked the performance was the same as always. So much for the "tune
No, its still slow. (Score:2)
Re:Ruby? (Score:2)
Whether that's a good tradeoff for faster development and less maintenance time is, of course, a matter of opinion.
Get the book (Score:4, Informative)
If you want to learn Ajax in Rails, the best thing I've read has been Dave Thomas' new book "Agile Web Development with Ruby on Rails" [pragmaticprogrammer.com]. The author of Ruby on Rails itself, David Heinemeier Hansson, is also a co-author. Great book, absolutely fantastic web development framework.
JavaScript libraries comparison (Score:2)
Re:JavaScript libraries comparison (Score:2)
Q: Can you mix PHP and RoR? (Score:2)
Re:Q: Can you mix PHP and RoR? (Score:3)
Hope that helps.
(This comes from someone who runs XMMS on a Mac
ASP.Net 2.0 (Score:3, Informative)
http://www.developer.com/net/asp/article.php/3506
Re:ASP.Net 2.0 (Score:2)
The advantage of Ruby is the way in which the callbacks are attached to the controls. In C# or J2EE or VB you basically need to create a special type of class to handle the callback, and create an instance of it. In Ruby you basically pass in a code block representing the action you want without having to create new classes
Please explain: What is the big fat hairy deal? (Score:2)
But this is called Ajax and suddenly everyone goes crazy.
Then there is ROR. I checked Ruby on Rails about a year ago. Then again a little more just the other month. It looks like Zopes younger brother. Not half as powerfull, and 5 years to late. But with Ruby, as to add even more extra geekness or what?
Please unders
Re:Please explain: What is the big fat hairy deal? (Score:2)
Rails: It's great! (but doesn't work) (Score:2)
Whatever.
My DBD::DBI applications are able to athenticate against MySQL just fine, but this app throws large gaudy errors when trying to connect to my (non-crippled) MySQL instance. (Yes, I ran through the tutorial in the hopes that the bug would have a
PHP Rails Ripoff (Score:2)
They use the exact same Javascript library that is used in Rails as well: Prototype [conio.net].
Rails is pretty decent. I guess the only issue is performance... you pretty much have to count out your typical web hosting account and have your own server. Mod_ruby [modruby.net] pretty much takes care of the performance issues and it installed without incident in my Apache 2.xx web server wi
Re:ASP.NET (Score:2)
Re:ASP.NET (Score:2, Funny)
Re:ASP.NET (Score:2)
Yeah, proof by assertion. That must be why Slashdot, Amazon, Livejournal and zillions of other "large scale site" don't use them, or what? Amazon and Slashdot use Perl, btw...
Either one is a vast improvement over Ruby/PHP/Perl is both performance and features.
What features of ASP.NET and J2EE are so unique and essential that they make them a "vast improvement" and the only v
Re:ASP.NET (Score:3, Insightful)
You don't understand one of the most important necessary preconditions for a larger web app in corporations - someone to approve it.
J2EE and ASP.NET have rich organizations that they can loan you to take key decision makers (CFOs) out to lunch to help approve expensive J2EE projects.
Compared to the Oracle sales guy flying my previous CFO out to some g
Re:ASP.NET (Score:2)
> corporate inter/intranet site you really have two
> choices ASP.NET and J2EE.
Agree with the parent, disagree with the GP.
Any large corporation has many layers of Web presence. There's their customer-focused Internet site, and I agree it'd be brave (not necessarily foolhardy) to use Rails for that.
However, there's also a LOT of intranet stuff going on, under the covers so to speak. Every person in that corporation needs access to internal information,
Re:ASP.NET (Score:2)
By George I think he's got it!
Why was it somebody wanted to use ASP.NET?
Re:Article's examples dont work (Score:2, Informative)
Re:AJAX, not Rails (Score:2)
By George I think he's got it!
Re:Suspicious until... (Score:2)
And when was the last time you found a site that just had plain HTML - no JavaScript, no Flash, no CSS, no nothing but hand-written (in NotePad) HTML?
Face it, the world is not going to change for your PDA or cellphone.
Re:Is RoR Part of Scientology? (Score:2)
Damn you, I spit up my coffee. L. Ron Hansson?
Yes, there appears to be a core set of Rails fanboys who never miss a chance to slag off ABR (Anything But [Ruby|Rails]). This is quite sad, as the freakish hype and nonsense coming from many of these people denigrates both the general Ruby community and the truly good things in Rails.
FWIW, I hope people do not equate Railers with the more general Ruby community, which is overwhelmingly tolerant and open to new ideas and alt