JRuby Great Addition To Java Development
An anonymous reader writes "JRuby combines the object-oriented strength of Smalltalk, the expressiveness of Perl, and the flexibility of the Java class libraries into a single, efficient rapid development framework for the Java platform. This article introduces JRuby, a sophisticated addition to your Java development toolbox."
Time to cue the Java-is-slow/big/bloated crowd and s/Java/JRuby/, though.
The World Wide Web is dying. Soon, we shall have only the Internet.
For a larger view of the language development being done similar to this, take a look at List of Java virtual machine languages.
I should think that most people will find at least something that appeals to them.
The JRuby article is part of the alt.lang.jre series, with announced articles about "Rhino, Nice, and NetRexx, and many other exciting alternate languages for the JRE". It looks like the articles are coming in this order, one around the beginning of each month.
Watch great movie opening scenes!
#hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
So when I tell somone that this is the right tool for the job , how am I supposed to pronounce it?
ja-ru-bee? ( gummie candy treat perhaps? )
har-you-bee ?
or jay-ru-bee as though it were named after Lee Harvey Oswald's killer Jack Ruby ( J. Ruby ) ?
Jython is the python/java bridge. Unfortunately, it hasn't had a new version in quite a while.. but it allows the same thing.
DO NOT DISTURB THE SE
...just skip Java and go with Ruby.
I needed a small app to analyze SQL query usage, and Ruby worked great. As long as you're conscientious about writing unit tests, you won't miss Java's static typing at all.
The Army reading list
I know that JavaScript does not have the same capabilities for server based OO apps as Ruby or Python (yet), but it is still a very competent language nonetheless for small to medium sized apps.
JavaScript's similarity to Java can also be helpful for readability.
The Moz guy's are still hacking the core of Rhino and are releasing new version regularly.
Rails (which I have not used) claims to be a complete MVC framework, whereas Hibernate (which I have used fairly extensively) focuses entirely on persistence, so comparing the two seems a bit odd.
:)
While I am sure that it is nice for prototyping things quickly, it does not seem to be solving the same problem as Hibernate. For example, Hibernate does not require the user to extend a some sort of base class in order for a POJO to gain persistence, which some developers would perceive to be a huge benefit.
In summary, this does not really seem like an apples to apples comparison, perhaps not even an apples to fruit comparison
The difference is, Groovy is not Ruby :-)
Groovy is a new language, and it borrows some syntax/features from Ruby (as well as Python).
http://tcljava.sourceforge.net/docs/website/index. html
Watch great movie opening scenes!
Groovy is, IMO, a near-clone of Ruby designed from the ground up to integrate with Java, and would probably be a better choice than JRuby. I think the Groovy documentation isn't quite there yet, tugh.
Are you adequate?
Groovy seems to have more momentum than JRuby, and to have had more work getting it properly debugged and so on. Again, I have not tried either, but I would be surprised if JRuby, in its current state of development, could beat Groovy.
Are you adequate?
Oh you mean the "language".
"Plus - want to add a new attribute to the object? With AR, all you do is add a column to the table. That's *ALL*. What do you do with Hibernate? Add a column to the table, add a private member and accessors to the POJO, and finally add lines in the XML config file that map that column into the object. The next steps involve testing it and then figuring out which thing you spelled incorrectly in the XML config that's preventing your app from working ("Oh - I spelled it 'naem' instead of 'name'!"). "
/** ...}
/**
/. to stop mangling some of the code examples. Good thing this isnt Python, eh? :)
Personally I use XDoclet (I assume that a fair number of Hibernate developers do as well) so here is how I would add a property to a class that I wanted to be persisted
* @hibernate.property
*/
public String getFoo(){
public void setFoo(String foo){..}
My class definition might look something like this:
* @hibernate.class table="monkey"
*/
public class Monkey{....}
In this case the "table="monkey"" bit would be optional, but very nice flexibility for working with existing tables, as well as for when encountering limits to table name size, etc.
No need to add a column, hibernate can handle that if needed. No editing any xml config file. Very non-tedious if you ask me. In fact, you don't really have to create any tables at all if you don't want to, as Hibernate is perfectly willing to create them all for you. Of course my definition will always require me to add getters and setters which is more verbose than the way Ruby would do it. In addition I have the flexibility to name the property something different than the column in the database, which is quite handy and desirable in many cases. In general Hibernate does not require to you follow any arbitrary naming convention with your columns, or relationships (since you can use a configuration file or in my case, XDoclet). I was looking thru the ActiveRecord docs, and I did not find some basic features that are quite important (however I did not spend too much time, so I may have overlooked them). For example, not all databases have auto-incrementing columns, so there needs to be a way to specify how one would use something like a sequence. Hibernate provides this. It also appears that you are only provided with the option of using native SQL for queries, which is not optimal if you want to at least pretend you are remaining database neutral (heh heh), while Hibernate provides the option of Criteria queries, hsql, or the ODMG(?) OQL interface.
Hibernate is simply trading more features for increased complexity. ActiveRecord appears to be taking a more bare bones approach. I'm not knocking ActiveRecord, it seems very cool, but it seems to be simpler by virtue of the fact that it just does less stuff, albeit probably stuff that handles 80% of cases just fine. By the way, I noticed that ActiveRecord does not support Oracle, or SQL Server. Does Ruby not have some sort of general database access API, or is the bridge component that ActiveRecord require just needed to tweak calls to that API?
Sorry, couldnt get
i think the 'jruby' project has been inactive for about 6 months. (and is a little behind versions: 1.6~ vs. 1.8.2)
(define frame (javax.swing.JFrame. "Slashdot Rul3z"))
(.setSize frame 400 400)
(.setVisible frame #t)