choosing ruby?

P

Piergiuliano Bossi

We are on the way to start a new project, a web application with a bunch
of pages and the following features:
*) users are maintained within a persistent repository (it could be as
easy as a yaml file, we are talking about no more than 10 users); first
page is a login page, of course
*) through these pages (around 10, warning & error pages included) a
user can invoke a transaction on a legacy system ==> we already have
java code that encapsulate a transaction or we can rewrite it in ruby,
it is a simple text based protocol over sockets, just like a telnet session
*) some transactions may not be invoked directly through the webapp, but
they are scheduled instead for late night execution; of course, we can
store these info in a yaml file too, there is no real need of a
relational db
*) we are talking initially about 2-3 transactions per day (not very
hard, isnt'it?)

We have an (almost-)ready framework in java for building webapps.
Although that, we are asking ourselves if developing in ruby could be a
better choice, mainly in terms of development speed. Infact, having
around 2 or 3 transactions per day I don't think that application speed
really matters (as long as users will not complain). We are just ruby
newbies, but we like it. We are considering perl too, because in our
team there's a perl fan, sponsoring mason for this project.

We can develop:
*) everything in java
*) mix ruby (html-based frontend, maybe fastcgi or mod_ruby) and java
(transaction invocation)
*) everything in ruby,
*) mix perl and java (we have tried a 30' spike with Inline::Java, it
seems to work)
*) everything in perl.

If we mix ruby & java I was thinking about using rjni or rjava.

One thing to take into account is that the application will be deployed
on a Sun cluster (5500, I guess) and I am not sure that the customer
will permit to compile the ruby interpreter there. They are quite
"conservative", if you know what I mean.
I know that this depends on os version, but may I expect to find in any
"official" place an already compiled interpreter for Solaris /whatever/?
This thing may affect negatively the whole choice. Unfortunately the
customer is pretty rigid on things like that.

Apart from that, development speed is the most important thing in this
project: not very comfortable, but sometimes you have to do it. Even if,
or because of we are quite in a rush we follow an XP process, applying
the whole set of practices like TDD, continuous integration, small
releases, etc. We don't want just to hack some code together. We are
quite experienced in java, a lot less in ruby, and even less in perl,
but with the latter we have at least an experienced person.

I'm sharing this with you both for hearing your opinions and for letting
you understand which kind of silly things may encourage or prevent ruby
adoption.

Thanks!
Giuliano
 
R

Robert Klemme

Piergiuliano Bossi said:
We are on the way to start a new project, a web application with a bunch
of pages and the following features:
*) users are maintained within a persistent repository (it could be as
easy as a yaml file, we are talking about no more than 10 users); first
page is a login page, of course
*) through these pages (around 10, warning & error pages included) a
user can invoke a transaction on a legacy system ==> we already have
java code that encapsulate a transaction or we can rewrite it in ruby,
it is a simple text based protocol over sockets, just like a telnet session
*) some transactions may not be invoked directly through the webapp, but
they are scheduled instead for late night execution; of course, we can
store these info in a yaml file too, there is no real need of a
relational db
*) we are talking initially about 2-3 transactions per day (not very
hard, isnt'it?)

We have an (almost-)ready framework in java for building webapps.
Although that, we are asking ourselves if developing in ruby could be a
better choice, mainly in terms of development speed. Infact, having
around 2 or 3 transactions per day I don't think that application speed
really matters (as long as users will not complain). We are just ruby
newbies, but we like it. We are considering perl too, because in our
team there's a perl fan, sponsoring mason for this project.

We can develop:
*) everything in java
*) mix ruby (html-based frontend, maybe fastcgi or mod_ruby) and java
(transaction invocation)
*) everything in ruby,
*) mix perl and java (we have tried a 30' spike with Inline::Java, it
seems to work)
*) everything in perl.

If we mix ruby & java I was thinking about using rjni or rjava.

One thing to take into account is that the application will be deployed
on a Sun cluster (5500, I guess) and I am not sure that the customer
will permit to compile the ruby interpreter there. They are quite
"conservative", if you know what I mean.
I know that this depends on os version, but may I expect to find in any
"official" place an already compiled interpreter for Solaris /whatever/?
This thing may affect negatively the whole choice. Unfortunately the
customer is pretty rigid on things like that.

Apart from that, development speed is the most important thing in this
project: not very comfortable, but sometimes you have to do it. Even if,
or because of we are quite in a rush we follow an XP process, applying
the whole set of practices like TDD, continuous integration, small
releases, etc. We don't want just to hack some code together. We are
quite experienced in java, a lot less in ruby, and even less in perl,
but with the latter we have at least an experienced person.

Considering all this I'd recommend to go for plain Java. Reasons:

- you're quite proficient in Java

- the JSP / Servlet framework is there and not really
difficult to understand (IMHO) if you know web app
basics (HTTP, HTML, control flow etc.) In your case
that seems sufficient, no need for some fancy web
app framework (don't use Struts)

- not mixing languages means saving yourself a lot of effort and
a huge source of bugs

- you might not even be allowed to use Ruby
(because of interpreter compilation)

Next would be Ruby since it is IMHO more easily learned than Perl and
there are webrick, eruby and others.

I would not consider Perl since you don't benefit in this situation:
Learning Ruby is easier and you don't need the additional speed that Perl
exposes over Ruby for some applications.

Kind regards

robert
 
M

Mauricio Fernández

I'm sorry to have to tell you that rjni is at best alpha :-(
I've got a nearly feature-complete version in my local repository but I
haven't released it, since I don't see myself spending much time on
it in the near future, and I don't want to mislead anybody into
thinking so.

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

The most important design issue... is the fact that Linux is supposed to
be fun...
-- Linus Torvalds at the First Dutch International Symposium on Linux
 
D

Don Dwoske

I would recommend Ruby wherever appropriate, but in this case, I agree
with Robert. His list of reasons was sound, I won't repeat them.

The only thing I would disagree with in his recommendation, is that you
*should* use an app framework - but not a fancy one. Struts is too
bloated for small apps and too big a learning curve. But having
something to easily do validation and unmarshalling of request
parameters is useful.

I'd use maverick with throwaway controllers and velocity instead of
struts and jsp.

http://mav.sourceforge.net

-don
 
R

Robert Klemme

Don Dwoske said:
I would recommend Ruby wherever appropriate, but in this case, I agree
with Robert. His list of reasons was sound, I won't repeat them.

Thanks! :)
The only thing I would disagree with in his recommendation, is that you
*should* use an app framework - but not a fancy one.

Exactly. Well, it depens on what you cann an "app framework". A servlet
container does a lot of what one might expect from a framework. But,
yeah, it should be lightweight.
Struts is too
bloated for small apps and too big a learning curve.
Exactly.

But having
something to easily do validation and unmarshalling of request
parameters is useful.

With Java the Servlet Container (aka Tomcat) takes care of marshalling and
unmarshalling data. Plus you need some library that can handle multipart
POSTS (also available from apache.org).

Validation is another story, but that's usually easy in a Servlet given
the size of this webapp.
I'd use maverick with throwaway controllers and velocity instead of
struts and jsp.
http://mav.sourceforge.net

I don't know maverick, but I'd like to comment on velocity. For the last
webapp we did we evaluated velocity, too, but came to the conclusion that
JSP is the better choice:

- better integrated, all the nifty details are
already handled by the servlet container, i.e.,
you don't need to write your velocity servlet,
you don't need to take care of modification
checks for the templates

- JSP's are compiled into classes

- better performance (your mileage may vary)

- with upcoming JSP spec 2.0 and Tomcat 5 support for
expressions all over the page, which means quite
convenient JSP coding (no need for
<c:eek:ut value="${fancyExpression}"/> but instead
${fancyExpression}

Kind regards

robert
 
P

Phil Tomson

Mauricio Fernández said:
I'm sorry to have to tell you that rjni is at best alpha :-(
I've got a nearly feature-complete version in my local repository but I
haven't released it, since I don't see myself spending much time on
it in the near future, and I don't want to mislead anybody into
thinking so.


Please _do_ release it. Perhaps you won't be having time to work on
it in the future, but others may want to work on it. In fact if you
don't think you'll be having time to work on it that's all the more
reason to 'release it into the wild' so that others can build upon
your foundation. As I recall, rjni was something that came out of the
2003 European Ruby conference and at the time there was a lot of
excitement about it because it is a great way to introduce Ruby into
Java shops - don't let it die! If you set rjni free it will have
more of a chance to develop and mature than if it sits in your local
repository. Perhaps the best thing you can do now to help rjni
development is to write up some minimal documentation on what you have
at this point (maybe use rdoc to speed things up).


Phil
 
D

Don Dwoske

There are lots of ways to build Java webapps, so perhaps we shouldn't
continue this thread for too long.. :)
With Java the Servlet Container (aka Tomcat) takes care of marshalling and
unmarshalling data.

I was referring of the marshalling / unmarshalling into a Java Bean from
request parameters (and translation into proper primitive types) not the
http decoding part - should have been more clear.

He'll also have to deal with page navigation and control flow, one thing
which Maverick gives you at low cost. Using 'logical' page names in the
application instead of hardcoded forwards is nice to have for small
apps, a must for large ones. Struts offers the same thing.
Validation is another story, but that's usually easy in a Servlet given
the size of this webapp.

Yup, he might not need anything... if he does, consider
http://formproc.sourceforge.net/
http://jakarta.apache.org/commons/validator/
I don't know maverick, but I'd like to comment on velocity. For the last
webapp we did we evaluated velocity, too, but came to the conclusion that
JSP is the better choice:

one more negative for velocity
1. more jsp books to help you learn

For the plus' of Velocity:

1. IMO, shoter learning curve (don't need book :)
2. smaller, cleaner syntax - expressions already looks like the
JSP 2.0 expression syntax
3. promotes good MVC architecture - whereas JSP can be used
in very wrong ways
4. negligible performance hit
5. does one thing very well

[more opinion on the velocity web site]

I have disliked JSP's since the beginning, and using them extensively
has only confirmed it. JSP 2.0 is however a vast improvement.


(e-mail address removed)
I'll second that recommendation for using Maverick.
I've created a PowerPoint presentation on using Maverick that I'd gladly
share if you're interested.

I wouldn't mind seeing that... I'm thinking of presenting something
myself ...
 
G

gabriele renzi

il 27 Jan 2004 10:07:13 -0800, (e-mail address removed) (Phil Tomson) ha
scritto::

Please _do_ release it.

can I say that I agree?
I wonder if the maintainer of rjava would like to adopt it, cause he
already planned a jni bridge.
 
M

Mauricio Fernández

Please _do_ release it. Perhaps you won't be having time to work on
it in the future, but others may want to work on it. In fact if you
don't think you'll be having time to work on it that's all the more

I have to confess it's not a matter of time -- it's just that I'm facing
the need to rewrite it all in C (for performance) and frankly that's no
fun :-|

I'll clean it a bit, add some docs and release it as another technology
preview.

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Because I don't need to worry about finances I can ignore Microsoft
and take over the (computing) world from the grassroots.
-- Linus Torvalds
 
J

Joel VanderWerf

Mauricio said:
I'm sorry to have to tell you that rjni is at best alpha :-(
I've got a nearly feature-complete version in my local repository but I
haven't released it, since I don't see myself spending much time on
it in the near future, and I don't want to mislead anybody into
thinking so.

If you release rjni you will be granted 3 wishes ;-)
 
M

Mauricio Fernández

Due to popular demand I have cleaned my latest code, added some API
documentation and released it under

http://www.thekode.net/ruby/rjni

For the record:

rjni exposes the Java Native Interface to Ruby. This allows the programmer
to instantiate Java objects, manipulate them, etc.. from Ruby.

Note that rjni is not meant to embed Ruby in Java, although it can be
used to ease integration in that case.

WARNING: THIS IS A TECHNOLOGY PREVIEW. THE SOFTWARE IS NOT EVEN ALPHA
QUALITY AT THE MOMENT AND IS NOT MEANT TO BE USED YET. IT IS ONLY
PROVIDED TO PRESENT THE TECHNIQUES EMPLOYED AND (HOPEFULLY) TO
ACCELERATE THE DEVELOPMENT.
If you release rjni you will be granted 3 wishes ;-)

Whom should I contact? :)

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

The state of some commercial Un*x is more unsecure than any Linux box
without a root password...
-- Bernd Eckenfels
 
T

Tom Copeland

WARNING: THIS IS A TECHNOLOGY PREVIEW. THE SOFTWARE IS NOT EVEN ALPHA
QUALITY AT THE MOMENT AND IS NOT MEANT TO BE USED YET. IT IS ONLY
PROVIDED TO PRESENT THE TECHNIQUES EMPLOYED AND (HOPEFULLY) TO
ACCELERATE THE DEVELOPMENT.

Very cool. Do you suppose someone could move it over to the rjni
project on RubyForge?

http://rubyforge.org/projects/rjni/

That might make it a bit easier for other folks to browse the code, make
comments, and so forth...

Yours,

Tom
 
M

Mauricio Fernández

Very cool. Do you suppose someone could move it over to the rjni
project on RubyForge?

http://rubyforge.org/projects/rjni/

Sure, I was the one who registered it ;)
Expect to find it there in a while (I'm copying it right now)...

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

'Ooohh.. "FreeBSD is faster over loopback, when compared to Linux
over the wire". Film at 11.'
-- Linus Torvalds
 
M

Mauricio Fernández

Sure, I was the one who registered it ;)
Expect to find it there in a while (I'm copying it right now)...

Done. From now on, the latest version of rjni will also be available at
http://rjni.rubyforge.org

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

'Ooohh.. "FreeBSD is faster over loopback, when compared to Linux
over the wire". Film at 11.'
-- Linus Torvalds
 

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
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top