# RoR or Java for community portal?

**URL:** <https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547>\
**Category:** Rails\
**Created:** [January 2, 2006, 11:21pm UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547 "2006-01-02T23:21:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 2, 2006, 11:21pm UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/1 "2006-01-02T23:21:46Z")

</div>

Hello Ruby users,

let me introduce myself briefly - I am a student at OvG University  
Magdeburg, Germany, and I hope to get some advice for a nonprofit  
student community portal I am involved with, just in case somebody is  
interested: [http://www.webuni.de](http://www.webuni.de), having around 3000 active users.  
Development is done on a voluntary basis by members of the community,  
mainly IT students with too much spare time.

At present, the code base is in Php - it’s huge, and nearly  
unmaintainable. There are 120 reported unfixed bugs, and as it’s really  
bad coding style - mixing presentation, SQL and PHP code - fixing bugs  
has become close to impossible.

We decided to move away from Php.

Java is popular at our university, and everybody is familiar with it. At  
first I proposed to use a java solution based on Hibernate, Tapestry and  
Spring/Acegi security. I have experience using these frameworks, but I’m  
not too convinced other junior developers will be able or willing to  
learn them, too. Also a java solution might be overkill, since it will  
always stay a regional community, mainly focused on the city and student  
life of Magdeburg, so performance is not the main issue.

Now that’s where Ruby on Rails comes in - as I read about rails, I  
thought this might be a way for us to go. I have read “Agile web  
development with Rails” and “Programming Ruby 2nd Edition”, but have no  
further practical Ruby experience.

Are there any experiences with using Ruby on Rails for a community  
portal? Maybe some experienced users could give some hints on where the  
advantages of Ruby and Rails are for this case.

One thing I imagined was, that developing application pieces - we call  
them “modules” - will be easier to implement since Ruby gives something  
like built-in static crosscutting through mix-ins.

Are there any experiences with unexperienced Java developers using Ruby?

Or is it just a matter of taste, and I’m better off with sticking to the  
Java solution?

Best regards  
Gregor M.

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 3, 2006, 5:00pm UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/2 "2006-01-03T17:00:25Z")

</div>

Go with Rails. I’m a Java developer working on my first Rails project  
and I’m finding it easy to learn and breathtaking in its productivity.  
For examples of community sites using Rails, see the flagship sites  
developed by the Rails inventors, Basecamp  
([http://www.basecamphq.com/](http://www.basecamphq.com/)), Backpack ([http://www.backpackit.com/](http://www.backpackit.com/)),  
and others developed by 37 Signals.

Quite frankly, as much as I love Java, for most web applications,  
Rails and Rails-like environments are the future.

dean

On 1/2/06, Gregor M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> unmaintainable. There are 120 reported unfixed bugs, and as it’s really  
> always stay a regional community, mainly focused on the city and student
> 
> Gregor M.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Dean W.  
[http://www.aspectprogramming.com](http://www.aspectprogramming.com)  
[http://www.newaspects.com](http://www.newaspects.com)  
[http://www.contract4j.org](http://www.contract4j.org)

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 3, 2006, 7:00pm UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/3 "2006-01-03T19:00:31Z")

</div>

On Jan 2, 2006, at 5:21 PM, Gregor M. wrote:

> advantages of Ruby and Rails are for this case.  
> I’ve been involved with community portal like software for years. All  
> but one effort in Java. A year or two ago I used Common Lisp on a  
> project. That was the end of Java for new projects of this type for  
> me. No More! I’ve been using Ruby on and off for various things for a  
> few years and with all the noise about Rails (and, to be honest, the  
> appearance of a book) I decided to check it out (by reading the  
> book). Pretty convincing, but… Just before Christmas I decided to  
> give Rails a serious shot. More than pretty convincing. And no book  
> could possibly convey this, you have to try it. RoR has a very very  
> good way of dealing with the View/Controller part of MVC – there  
> can’t be anything like it in Java, and there could be but isn’t in  
> Common Lisp. The way this works is wonderful. If you are a Java  
> programmer and haven’t tried RoR you _just_ _don’t_ _know_ what I  
> mean. If you are a smalltalk or lisp programmer, you are going to  
> experience something like what you are familiar with but it’ll be so  
> unexpected you’ll be shocked.

The performance of RoR is not an issue for my stuff. I doubt it will  
be for yours either (3000 users is well within range of Rails unless  
they are doing something unusual (but this _is_ a university  
environment so maybe they are :-))

> One thing I imagined was, that developing application pieces - we call  
> them “modules” - will be easier to implement since Ruby gives  
> something  
> like built-in static crosscutting through mix-ins.

Wow. You _are_ a Java head 🙂 Mixins, compile-time execution of  
code, and reopening of classes, especially in combination, provide  
for a very nice programming experience.

This is where I’d be concerned with Rails. I don’t know how RoR will  
work with independent development groups working on quasi-independent  
chunks of code. I don’t use ActiveRecord, and I’m suspicious of the  
concept of ‘model’ supported by this kind of thing, but I have to  
admit that ActiveRecord looks to be well done. I don’t see the  
packaging of these development efforts formally set out in RoR. This  
is not to say they are not there, but this doesn’t appear to have  
been a major focus so far. Now, lets be serious here – I think there  
are several ways to achieve this, there is nothing in RoR that  
prevents it. But you are going to have to be careful. Watch out for  
model conflicts (the controllers and views can, and should, be  
modularised but I can’t see how to do this in the model – models are  
named by a symbol, and symbols in Ruby are not modularised – this  
worries me (somebody, please tell me I’m wrong)). (Well, the fact is,  
I’ve replace the model that comes with RoR with my own based on xampl  
(see my sig) and that is completely modularised and so I’m pretty  
sure that some RoR solution should be possible). The RoR ‘engine’  
approach looks interesting too.

> Are there any experiences with unexperienced Java developers using  
> Ruby?

Did you mean experienced Java developers using RoR/Ruby? If so, then  
I’ll say it is a good experience. I think Ruby is easier to learn  
than Java, but maybe the tools are a bit raw for beginners, I don’t  
know. RoR is much more comprehensible in a much shorter time than any  
Java framework I’ve used.

> Or is it just a matter of taste, and I’m better off with sticking  
> to the  
> Java solution?

No, it is not a matter of taste. Unfortunately, that isn’t enough to  
say you aren’t better sticking to Java 🙂

Cheers,  
Bob

> Best regards  
> Gregor M.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

* * *

Bob H. – blogs at \<[http://www.recursive.ca/](http://www.recursive.ca/)  
hutch/\>  
Recursive Design Inc. – [http://www.recursive.ca/](http://www.recursive.ca/)  
Raconteur – [http://www.raconteur.info/](http://www.raconteur.info/)  
xampl for Ruby – [http://rubyforge.org/projects/xampl/](http://rubyforge.org/projects/xampl/)

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 3, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/4 "2006-01-03T21:15:08Z")

</div>

Hello Bob,

thanks for you taking the time to answer!

> I’ve been involved with community portal like software for years. All  
> but one effort in Java. A year or two ago I used Common Lisp on a  
> project. That was the end of Java for new projects of this type for  
> me. No More! I’ve been using Ruby on and off for various things for a  
> few years and with all the noise about Rails (and, to be honest, the  
> appearance of a book) I decided to check it out (by reading the  
> book). Pretty convincing, but… Just before Christmas I decided to  
> give Rails a serious shot. More than pretty convincing. And no book  
> could possibly convey this, you have to try it. RoR has a very very  
> good way of dealing with the View/Controller part of MVC – there  
> can’t be anything like it in Java, and there could be but isn’t in  
> Common Lisp. The way this works is wonderful. If you are a Java  
> programmer and haven’t tried RoR you _just_ _don’t_ _know_ what I  
> mean. If you are a smalltalk or lisp programmer, you are going to  
> experience something like what you are familiar with but it’ll be so  
> unexpected you’ll be shocked.

Sounds like we should give it a chance by starting a prototype in Ruby.

> The performance of RoR is not an issue for my stuff. I doubt it will  
> be for yours either (3000 users is well within range of Rails unless  
> they are doing something unusual (but this _is_ a university  
> environment so maybe they are :-))

It was really hard for me to find hard facts on RoR performance. One  
website mentioned the performance is eight times less than Java - that  
is without any DB access involved. This kind of scared me, but as our  
Php application has no performance issues, there shouldn’t be any in  
ruby, as I heared it is comparable in speed. Can you confirm that?

> Watch out for  
> model conflicts (the controllers and views can, and should, be  
> modularised but I can’t see how to do this in the model – models are  
> named by a symbol, and symbols in Ruby are not modularised – this  
> worries me (somebody, please tell me I’m wrong)). (Well, the fact is,  
> I’ve replace the model that comes with RoR with my own based on xampl  
> (see my sig) and that is completely modularised and so I’m pretty  
> sure that some RoR solution should be possible). The RoR ‘engine’  
> approach looks interesting too.

What engine approach? So in short ActiveRecord models cannot be enhanced  
by modules, right? Thats no good news, as this was a primary feature I  
was looking for. I looked into the xampl project, but then I would have  
to convince the team that we should replace the model part of a MVC  
framework I’m proposing to use, guess they’ll wonder if it can then be  
so good after all. I’ll look deeper into this, anyway.

> Did you mean experienced Java developers using RoR/Ruby? If so, then  
> I’ll say it is a good experience. I think Ruby is easier to learn  
> than Java, but maybe the tools are a bit raw for beginners, I don’t  
> know. RoR is much more comprehensible in a much shorter time than any  
> Java framework I’ve used.

Hmm, I think we’ll just have to test this on the prototype. I meant  
unexperienced developers, since most developers are “just” IT students,  
so there are also people with no deep insight in advanced java  
programming, though we have some “freaks” also 🙂

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 4, 2006, 12:14am UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/5 "2006-01-04T00:14:37Z")

</div>

‘Engine’ approach: [http://rails-engines.org](http://rails-engines.org)

- james

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 4, 2006, 3:37am UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/6 "2006-01-04T03:37:12Z")

</div>

On Jan 3, 2006, at 3:15 PM, Gregor M. wrote:

> Hello Bob,
> 
> thanks for you taking the time to answer!

No problem. I hope I’m not confusing thing…

> > good way of dealing with the View/Controller part of MVC – there  
> > can’t be anything like it in Java, and there could be but isn’t in  
> > Common Lisp. The way this works is wonderful. If you are a Java  
> > programmer and haven’t tried RoR you _just_ _don’t_ _know_ what I  
> > mean. If you are a smalltalk or lisp programmer, you are going to  
> > experience something like what you are familiar with but it’ll be so  
> > unexpected you’ll be shocked.
> 
> Sounds like we should give it a chance by starting a prototype in  
> Ruby.

For sure, but this isn’t the only reason to use Ruby. W.r.t.  
prototyping, I was talking to a colleague this afternoon about how I  
can will be using Rails and Ruby to workout some design issues then  
re-implement in Java. This’ll still save me a ton of time.

> > The performance of RoR is not an issue for my stuff. I doubt it will  
> > be for yours either (3000 users is well within range of Rails unless  
> > they are doing something unusual (but this _is_ a university  
> > environment so maybe they are :-))
> 
> It was really hard for me to find hard facts on RoR performance. One  
> website mentioned the performance is eight times less than Java - that  
> is without any DB access involved. This kind of scared me, but as our  
> Php application has no performance issues, there shouldn’t be any in  
> ruby, as I heared it is comparable in speed. Can you confirm that?

Ruby is slower than Java, 8x sounds possible. However, we _are_  
talking about web apps and the internet will be the bottle neck even  
with Ruby. And then when you add in DB access, well, I don’t know if  
there’s a lot of practical difference. I do not think a typical  
community portal is going to see anything like an 8x difference –  
I’m not seeing any difference on the stuff I’m playing with (in fact,  
on my powerbook G4 with 2GB of RAM I think Ruby serves dynamic  
content a bit faster, it sure as hell runs faster in development mode  
(about 2s in RoR to start up, about 40 seconds in Java to start – on  
my desktop dual CPU G5 thing RoR starts up in a fraction of a second  
– this is _very_ nice).

> What engine approach?

[http://rails-engines.org](http://rails-engines.org)

> So in short ActiveRecord models cannot be enhanced  
> by modules, right? Thats no good news, as this was a primary feature I  
> was looking for. I looked into the xampl project, but then I would  
> have  
> to convince the team that we should replace the model part of a MVC  
> framework I’m proposing to use, guess they’ll wonder if it can then be  
> so good after all. I’ll look deeper into this, anyway.

It isn’t that bad, sorry to leave that impression. _Inside_ the model  
there are no restrictions or problems. Modules are also used to  
control name conflicts. In Ruby, symbols are _global_ they are not in  
a module. So if you have two models, both called :model then you’ve  
got a problem. Now, I _think_ this can be dealt with but I don’t see  
any explicit discussion in ActiveRecord documentation (I don’t mean  
anything more than that). And considering how easy it was for me to  
deal with this on my own, I can’t imagine that there isn’t some way  
to deal with this already in RoR that I just don’t know about. Now, I  
happened to see something about model prefixes this afternoon, I have  
not pursued this, but if it is what it sounds like, then this will do  
the trick well enough.

This may all be a simple documentation problem… documentation  
missing, or me just being a poor reader of the documentation 🙂

> so there are also people with no deep insight in advanced java  
> programming, though we have some “freaks” also 🙂

Sounds like fun!

Cheers,  
Bob

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

* * *

Bob H. – blogs at \<[http://www.recursive.ca/](http://www.recursive.ca/)  
hutch/\>  
Recursive Design Inc. – [http://www.recursive.ca/](http://www.recursive.ca/)  
Raconteur – [http://www.raconteur.info/](http://www.raconteur.info/)  
xampl for Ruby – [http://rubyforge.org/projects/xampl/](http://rubyforge.org/projects/xampl/)

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 5, 2006, 1:57am UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/7 "2006-01-05T01:57:49Z")

</div>

> Ruby is slower than Java, 8x sounds possible. However, we _are_  
> talking about web apps and the internet will be the bottle neck even  
> with Ruby. And then when you add in DB access, well, I don’t know if  
> there’s a lot of practical difference.

Well, I left DB Access out since Hibernate will beat ActiveRecord hands  
down anyway I suppose - no second level cache, no query cache and so  
on… Well, at least ActiveRecord won’t be slower than handcoded PHP  
database access and is much easier to use.

> I do not think a typical  
> community portal is going to see anything like an 8x difference –

I agree, as we don’t have problems with PHP, too. Fast enough ist fast  
enough. Period.

[http://rails-engines.org](http://rails-engines.org) - looks interesting, I think we will make use  
of this, thanks.

> Well, looking at the source code… The  
> ActionController::dependencies#model method calls  
> ActionController::dependencies#require\_dependencies which in turn  
> calls Object.require\_dependency. Object.require\_dependency is defined  
> in Object in the ActiveSupport file dependencies.rb (by re-opening  
> the Object class) and calls ActiveSupport::Dependencies#depend\_on  
> which ultimately ends up calling either load or require on a file name.
> 
> So, to cut it short, instead of writing:
> 
> model :my\_model
> 
> everywhere, you can write:
> 
> model ‘my\_application/my\_model’
> 
> And all is well.
> 
> I no longer have any concern about the model side of things.

Thank you very much for looking into the code and clarifying this. That  
was really helpful to me!

Anyway, today I held my first presentation about the problems in our  
present application, proposed useful patterns for solving them and then  
presented a Java solution based on Hibernate, Spring, Tapestry, Acegi  
Security. This stack is suited to good Java web development, but it has  
one big problem: Really steep learning curve, much time needed to learn  
it. Then I told them that I will present Ruby on Rails on Monday,  
offering all “really” needed functionality from the Java frameworks plus  
higher productivity and other useful features - of course everybody was  
interested - and so am I 🙂

Thanks again for helping out!

Cheers  
Gregor

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 4, 2006, 2:28pm UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/8 "2006-01-04T14:28:18Z")

</div>

On Jan 3, 2006, at 9:12 PM, Bob H. wrote:

> It isn’t that bad, sorry to leave that impression. _Inside_ the  
> sounds like, then this will do the trick well enough.
> 
> This may all be a simple documentation problem… documentation  
> missing, or me just being a poor reader of the documentation 🙂

Well, looking at the source code… The  
ActionController::dependencies#model method calls  
ActionController::dependencies#require\_dependencies which in turn  
calls Object.require\_dependency. Object.require\_dependency is defined  
in Object in the ActiveSupport file dependencies.rb (by re-opening  
the Object class) and calls ActiveSupport::Dependencies#depend\_on  
which ultimately ends up calling either load or require on a file name.

So, to cut it short, instead of writing:

```
model :my_model

```

everywhere, you can write:

```
model 'my_application/my_model'

```

And all is well.

I no longer have any concern about the model side of things.

Cheers,  
Bob

* * *

Bob H. – blogs at \<[http://www.recursive.ca/](http://www.recursive.ca/)  
hutch/\>  
Recursive Design Inc. – [http://www.recursive.ca/](http://www.recursive.ca/)  
Raconteur – [http://www.raconteur.info/](http://www.raconteur.info/)  
xampl for Ruby – [http://rubyforge.org/projects/xampl/](http://rubyforge.org/projects/xampl/)

---

<div class="post-metadata">

**Author:** ![hildolfur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e8cbc/32.png) [@hildolfur](https://www.ruby-forum.com/u/hildolfur)\
**Post date:** [January 5, 2006, 2:51am UTC](https://www.ruby-forum.com/t/ror-or-java-for-community-portal/51547/9 "2006-01-05T02:51:44Z")

</div>

On Jan 4, 2006, at 7:57 PM, Gregor M. wrote:

> plus  
> higher productivity and other useful features - of course everybody  
> was  
> interested - and so am I 🙂

Let us know how it goes.

Cheers,  
Bob

* * *

Bob H. – blogs at \<[http://www.recursive.ca/](http://www.recursive.ca/)  
hutch/\>  
Recursive Design Inc. – [http://www.recursive.ca/](http://www.recursive.ca/)  
Raconteur – [http://www.raconteur.info/](http://www.raconteur.info/)  
xampl for Ruby – [http://rubyforge.org/projects/xampl/](http://rubyforge.org/projects/xampl/)
