Running Java from Rails

J

Javier_CH

Does anyone know of a possibility to run Java-Classes out of RoR (e.g.
use java objects in a ruby context)?

I'm a newbie regarding RoR coming from Java-Land and I'm asking myself
if there's an easy way for me to code all the complex stuff in Java
and use it in RoR.

Thanx for your help!
 
D

Drew Olson

Javier_CH said:
Does anyone know of a possibility to run Java-Classes out of RoR (e.g.
use java objects in a ruby context)?

I'm a newbie regarding RoR coming from Java-Land and I'm asking myself
if there's an easy way for me to code all the complex stuff in Java
and use it in RoR.

Thanx for your help!

Coming from Java, let me tell you that coding the "complex stuff" in
ruby is much nicer than coding it in Java IMO. Take the time to learn
ruby and you will be extremely happy.

-Drew
 
S

Sammy Larbi

I don't know if there is such a way, but I think that you'd be losing
all the benefit of Ruby by doing the complex stuff (or anything, really)
in Java.


Javier_CH wrote, On 2/12/2007 10:40 AM:
 
A

Adam Keys

Does anyone know of a possibility to run Java-Classes out of RoR (e.g.
use java objects in a ruby context)?

I'm a newbie regarding RoR coming from Java-Land and I'm asking myself
if there's an easy way for me to code all the complex stuff in Java
and use it in RoR.

I'm using RJB[1] to call a Java RMI client that talks to our backend
Java code. Working pretty well thus far. The maintainer is pretty
response too.

[1] http://rjb.rubyforge.org/
 
J

Javier_CH

Coming from Java, let me tell you that coding the "complex stuff" in
ruby is much nicer than coding it in Java IMO. Take the time to learn
ruby and you will be extremely happy.
You're right, but I think bytecode is probably faster then interpreted-
code when it comes to performance. What have your experiences been?

Second, we've a information retrieval project written in java (lucene)
which I'd like to use and I don't think using it over a webservice is
an option...

Thanks for your replies.
 
A

Alex Young

Thought I'd just weigh in here...

Javier_CH said:
You're right, but I think bytecode is probably faster then interpreted-
code when it comes to performance. What have your experiences been?
Firstly, the chances are that it doesn't matter - developer speed beats
cpu speed in general. Secondly, you're probably right, but benchmark it
- don't guess.
Second, we've a information retrieval project written in java (lucene)
which I'd like to use and I don't think using it over a webservice is
an option...
If you're interested in Lucene but don't need any of the Lucene-specific
tools, it's really worth having a look at Ferret. It's a Lucene-alike
written in C with Ruby bindings, and it's very, very good.

Hope this helps :)
 
J

Jeremy McAnally

Or, optionally, Ruby can work with Solr, a Lucene based search service.

http://wiki.apache.org/solr/SolRuby

--Jeremy

Thought I'd just weigh in here...


Firstly, the chances are that it doesn't matter - developer speed beats
cpu speed in general. Secondly, you're probably right, but benchmark it
- don't guess.

If you're interested in Lucene but don't need any of the Lucene-specific
tools, it's really worth having a look at Ferret. It's a Lucene-alike
written in C with Ruby bindings, and it's very, very good.

Hope this helps :)


--
http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
 
R

Richard Conroy

You're right, but I think bytecode is probably faster then interpreted-
code when it comes to performance. What have your experiences been?

This is premature optimisation. Which in engineering terms is a great
way to ruin a project. Its not like Rails insists that everything is
written in Rails/Ruby anyway.

A lot of the CPU intensive stuff, like funky graphics stuff is typically
handed over to binary stuff anyway.
Second, we've a information retrieval project written in java (lucene)
which I'd like to use and I don't think using it over a webservice is
an option...

Well look at JRuby. It seems to be what you need, though it is a bit
early to consider running a full Rails install on it. It just about runs
Rails, which is probably a by-word for 'but not in a mission critical
environment'.

The JRuby guys are pretty sharp though, and I don't expect that
situation to stay that way for long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top