[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Running Java from Rails

Javier_CH

2/12/2007 4:39:00 PM

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!

7 Answers

Drew Olson

2/12/2007 4:48:00 PM

0

Javier_CH wrote:
> 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

--
Posted via http://www.ruby-....

Sammy Larbi

2/12/2007 4:49:00 PM

0

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:
> 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!
>
>
>
>
>


Adam Keys

2/12/2007 5:07:00 PM

0

On Feb 12, 2007, at 10:40 AM, Javier_CH wrote:
> 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.ruby...

--
~akk
http://there...



Javier_CH

2/12/2007 5:17:00 PM

0

On 12 Feb., 17:47, Drew Olson <olso...@gmail.com> wrote:
> 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.


Alex Young

2/12/2007 5:38:00 PM

0

Thought I'd just weigh in here...

Javier_CH wrote:
> On 12 Feb., 17:47, Drew Olson <olso...@gmail.com> wrote:
>> 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?
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 :-)

--
Alex

Jeremy McAnally

2/12/2007 5:45:00 PM

0

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

http://wiki.apache.org/so...

--Jeremy

On 2/12/07, Alex Young <alex@blackkettle.org> wrote:
> Thought I'd just weigh in here...
>
> Javier_CH wrote:
> > On 12 Feb., 17:47, Drew Olson <olso...@gmail.com> wrote:
> >> 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?
> 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 :-)
>
> --
> Alex
>
>


--
http://www.jeremymca...

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

My blogs:
http://www.mrneigh...
http://www.rubyinpra...

Richard Conroy

2/12/2007 6:48:00 PM

0

On 2/12/07, Javier_CH <vazqujav@gmail.com> wrote:
> On 12 Feb., 17:47, Drew Olson <olso...@gmail.com> wrote:
> > 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?

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.