Is this an elaborate hoax/troll?

Rails doesn’t prevent you from using stored procs. I use them on
Postgres
and haven’t had any problems. Expecting it to be able to automatically
map
from a proc to the object layer seems to me to be unreasonable, since
procs
can do anything and everything and not just CRUD.

There are a number of missing ruby features, unicode, i18n, timezone
supt,
etc. that may prevent it’s immediate use for certain kinds of enterprise
apps, but the vast majority of enterprise apps are single-language
anyway.
Java’s date support was problematic for a long time, as was its
threading.
Ruby will get there, too.

Gregory is right. There’s a danger, I think, in trying to improve Ruby
by
making it more Java-like. It needs improvements in both performance and
in
additional functionality, but if you want a Java like language, try
Java.

Support for Oracle; while I haven’t tried using Oracle with Rails
personally, there’s enough people having trouble with it to make me
suspect that Oracle+Rails might not be a good combination

I’d be interested in hearing any concerns about using Oracle with Rails.
We’ve been using it for production apps for 6+ months, with no issues.

Justin F. wrote:

Well, it’s still generally called a virtual machine (over and over on
that page). And, in
relation to the original poster’s point, the interpreted parse tree
approach is generally
less performant than the bytecode approach. At least I’ve seen some
numbers indicating that.

However, raw speed comparisons don’t tell the whole story – as the Java
world has been
saying for years. I wouldn’t go there other than to state that the
anti-VM sentiment is
based on urban legends (and the early JVM performance, which sucked).

b

On 3/28/06, David J. [email protected] wrote:

On Tue, 2006-03-28 at 21:59 -0600, Jason P. wrote:

If that’s your contention, then why are you posting to the Rails
mailing list and not the Ruby mailing list?

Because someone else started this thread and I thought it looked
interesting.

you would say that! you - you - you JAVA GUY!


Giles B.
www.gilesgoatboy.org

The messenger was not slammed because of the message. He was slammed because:
A) Nobody likes people who proclaim themselves industry leaders when
ho showed many times that he had marginal programming knowledge
B) He didn’t even seem to have looked at Ruby. His message was full of
errors and FUD. Even though he tried to hide it later. (ceck out JHH’s
post to see what I am talking about)

Yeah–it wasn’t so much the message that led me to believe it was
hoax/troll, but some of the (possibly now edited) content.

There were some strange stuff in there that made it smell like
flamebait (and truth be told, all good trolls invoke insecurity via
some level of validity).

On Wed, 2006-03-29 at 15:27 -0700, Giles B. wrote:

On 3/28/06, David J. [email protected] wrote:

On Tue, 2006-03-28 at 21:59 -0600, Jason P. wrote:

If that’s your contention, then why are you posting to the Rails
mailing list and not the Ruby mailing list?

Because someone else started this thread and I thought it looked
interesting.

you would say that! you - you - you JAVA GUY!

:o) Except when I’m C, or COBOL, or VB, or XSLT, or Pascal, or Object
Pascal (aka Delphi), or Assembly, or NetRexx, or Python, or SQL, or …

On 3/29/06, Larry W. [email protected] wrote:

Rails doesn’t prevent you from using stored procs. I use them on Postgres
and haven’t had any problems. Expecting it to be able to automatically map
from a proc to the object layer seems to me to be unreasonable, since procs
can do anything and everything and not just CRUD.

OK, how do you do that? I keep hearing bits and pieces about how it’s
“possible” but no code.

I want to be able to take user input, send it to a postgres function,
and know if it succeeded or failed. If it failed, I would like to be
able to get at the error message.

I also, in my fantasy dream land, want to take user input, send it to
a set returning function, and use the resulting output.

AFAICT there are no FAQ, Blog entries, tutorials or anything on this.

The battle for the enterprise is not worth winning, why fight it.

Because if you can win there, you can win anywhere. In the enterprise,
you win by making the best bottom line consistently. You achieve the
best bottom line through good communication and technical excellence.

Not really. The whole philosophy of Rails is based on the idea that
what’s best for some gigantic corporation with eight quadrillion
employees isn’t what’s best for small businesses. Rails is opinionated
software highly optimized for small business.

That enterprise “thought leader” is a bit of a crackhead, but there
are differences between what extremely large intracorporate
applications require and what most systems need. I’d imagine there are
probably lots of overarchitected enterprise apps that could run on
Rails quite happily, though.


Giles B.
www.gilesgoatboy.org

On Wed, 2006-03-29 at 15:21 -0700, Giles B. wrote:

The battle for the enterprise is not worth winning, why fight it.

Because if you can win there, you can win anywhere. In the enterprise,
you win by making the best bottom line consistently. You achieve the
best bottom line through good communication and technical excellence.

Not really. The whole philosophy of Rails is based on the idea that
what’s best for some gigantic corporation with eight quadrillion
employees isn’t what’s best for small businesses. Rails is opinionated
software highly optimized for small business.

But, the Ruby and Rails combination is productive and robust enough that
big business is becoming interested in it (hence my own presence on this
list, and that of some others in enterprise computing environments).

That enterprise “thought leader” is a bit of a crackhead, but there
are differences between what extremely large intracorporate
applications require and what most systems need.

Even many “bread-and-butter” apps and tools in the enterprise can be
handled by Rails today. It just can’t (yet) handle the heavy hitting
stuff because of a few implementation issues that will be relatively
straightforward (though not necessarily easy) to correct.

I’d imagine there are
probably lots of overarchitected enterprise apps that could run on
Rails quite happily, though.
Overarchitected? I’m not sure what you mean. I have seen poorly
architected apps, and apps that solved complex problems, but I have
never seen something that I could truly call overarchitected. Could you
elaborate?

I agree that many enterprise apps could be built with a fraction of the
lines of code and with better results under rails (than under J2EE), but
there are places where ruby (and rails) just misses the target by a
small margin, in places that you can’t easily fake out. Threading
support is really the core piece that is missing from Ruby that prevents
it from cleaning up in the heavyweight division.

Rails origins with non-compliant backing stores (MySQL) shows in its use
of SQL92 keywords as property names (POSITION is a particular thorn in
the flesh for me at this moment). People using SQL92 or later compliant
RDBMS’ (postgres, firebird, oracle, DB2) cannot use ActiveRecord’s
acts_as_list modifier, for example.

These issues are correctable without compromising the viability of Rails
for small systems. They are not core design issues, they are maturity
issues.

All the code was generated so it’s a bit vague and it’s prototype code.
You
would need to clean it up. Also, I haven’t used this code in a while so
no
promises.

I hope you find it helpful.

the short answer is you use the postgresql library
http://wiki.rubyonrails.com/rails/pages/PostgreSQL

then try something like this:

class CountryDao
def self.get_connection
DAO.get_connection # see below
end

this returns a single row:

def self.get(user_id, object_id, get_deleted)
res = get_connection.exec(“select * from get_country(#{user_id},
#{object_id}, #{get_deleted});”)
if res.num_tuples > 0
country = Country.new()
populate(country, res, 0)
else
raise “not found exception”
end
res.clear
country
end

this returns a refcursor

def self.get_result_set(query_string)
    get_connection.exec("BEGIN;")
     result = get_connection.query(query_string)
     refcursor_name = result[0].to_s
     res = get_connection.query("FETCH ALL IN 

"#{refcursor_name}";")
get_connection.exec(“COMMIT;”)
res
end

def self.populate(object, result_set, row_number)
         object.object_id =  result_set.getvalue(row_number ,0)
        object.updated_by =  result_set.getvalue(row_number ,1)
        object.updated =  result_set.getvalue(row_number ,2)
        object.deleted =  result_set.getvalue(row_number ,3)
        object.parent_id =  result_set.getvalue(row_number ,4)
        object.name =  result_set.getvalue(row_number ,5)
        object.description =  result_set.getvalue(row_number ,6)

        return object
end

end

The DAO class looks like this:

require “postgres”

class DAO

@@conn = PGconn.connect("localhost", 5432, "", "", "Test", 

“username”,
“password”)

def self.get_connection
  @@conn
end

end

On Thursday 30 March 2006 03:35, David J. wrote:

Rails origins with non-compliant backing stores (MySQL) shows in its
use of SQL92 keywords as property names (POSITION is a particular
thorn in the flesh for me at this moment). People using SQL92 or
later compliant RDBMS’ (postgres, firebird, oracle, DB2) cannot use
ActiveRecord’s acts_as_list modifier, for example.

I probably don’t understand your problem, but I have columns
named “position” in several of my tables and PostgreSQL (8.0.x) works
just fine with this.

Michael


Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/

Hello.

JRuby (Ruby running under a JVM) is actually very interesting to us, but
it is about 80 bugs away from being ready for active consideration.
JRuby offers the internationalization, threading, and other support that
regular Ruby does not yet, because the underlying JVM and Java runtime
classes support them.

Allow me to emphasis this.

JRuby has the potential to rock Ruby on Rails like RoR rocked Ruby!
http://jruby.sourceforge.net/

To be enterprise-ready means integration. Consider the impact of
Apache
XML stack including Cocoon, JCR, JDBC, JTA, Hibernate and Unicode
available
to RoR.
http://xml.apache.org/

To be enterprise-ready means reliable application servers. Consider
RoR on
the cluster-ready JBoss microkernel.
http://labs.jboss.com/portal/jbossas/architecture

Only to name a very few :slight_smile: Remember that J2EE is not just EJB.
http://en.wikipedia.org/wiki/Java_Platform%2C_Enterprise_Edition
http://de.wikipedia.org/wiki/Bild:J2ee-overview.png
German:
http://de.wikipedia.org/wiki/J2EE

BTW: You could integrate RoR with J2EE using Hessian. This is the better
approach if you need Ruby libraries that depend on native shared
libraries.
http://wiki.caucho.com/Hessian_-_Ruby_implementation
http://jruby.sourceforge.net/docs/faq.shtml

I can’t wait for the second birth of Ruby on Rails.

Regards,

Gert Thiel

On Thursday 30 March 2006 11:18, Gert Thiel wrote:

JRuby has the potential to rock Ruby on Rails like RoR rocked Ruby!

Somehow I don’t see this.

To be enterprise-ready means integration. Consider the impact of
Apache XML stack including Cocoon, JCR, JDBC, JTA, Hibernate and
Unicode available to RoR.

And that’s so great? If you need all this stuff, why not just use
Java/J2EE, maybe with a healthy dose of Spring thrown in, from the
start? If you don’t like Java-the-language, well, then go for Groovy.

To be enterprise-ready means reliable application servers. Consider
RoR on the cluster-ready JBoss microkernel.

I take it that this would require a complete rewrite of Rails.

I agree wholeheartedly that interoperability is important. I don’t agree
on the assumed means to achieve it. Has the SOA ideal/fad died already?
Rails can nicely interoperate on the level of services. There’s really
no need to absorb it into Java.

Michael


Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/

Michael S. wrote:

And that’s so great? If you need all this stuff, why not just use
Java/J2EE, maybe with a healthy dose of Spring thrown in, from the
start? If you don’t like Java-the-language, well, then go for Groovy.

It’s just more powerful than either straight Java or straight Ruby.
Groovy is just an
attempt to write Ruby-esque code in the JVM. JRuby would likely render
it pointless. But
actually, Java 6 will probably render both JRuby and Groovy pointless:
it will support
running several dynamic languages (PHP, Javacript, Ruby, etc.) within
the JVM and straight
from Java code.

To be enterprise-ready means reliable application servers. Consider
RoR on the cluster-ready JBoss microkernel.

I take it that this would require a complete rewrite of Rails.

NO. That would be stupid. The whole goal is to be able to run Ruby code,
unmodified, in
the JVM.

I agree wholeheartedly that interoperability is important. I don’t agree
on the assumed means to achieve it. Has the SOA ideal/fad died already?
Rails can nicely interoperate on the level of services. There’s really
no need to absorb it into Java.

The goal is not to “absorb Ruby into Java”. The goal is to allow even
closer
interoperation than services allow. There is nothing to fear in this and
everything to be
gained.

b

On Wed, Mar 29, 2006 at 07:35:21PM -0600, David J. wrote:
} On Wed, 2006-03-29 at 15:21 -0700, Giles B. wrote:
[…]
} > I’d imagine there are probably lots of overarchitected enterprise
apps
} > that could run on Rails quite happily, though.
}
} Overarchitected? I’m not sure what you mean. I have seen poorly
} architected apps, and apps that solved complex problems, but I have
never
} seen something that I could truly call overarchitected. Could you
} elaborate?
[…]

I will give an example of an overarchitected app. This is not a web app,
but rather a .NET thick client. The names of the various companies
involved
are withheld to protect my butt. Basically, the project is in-house,
mission-critical software. It is backed by several large databases, and
performs a variety of data entry, manipulation, cleaning, crunching, and
reporting functions.

The basis of this application is the almighty framework. In this
application, there are persisted objects which are all represented in a
single table with universally relevant information like parent object,
plus
side join tables for specific types. Loading and saving is handled
automagically by the framework. All such objects exist in memory as an
instance object which holds onto an ADO.NET typed dataset.

All screens (and partial screens) must be implemented as subclasses of a
particular framework class, which does framework magic with the
persisted
objects. Screens are actually shown to the user in nested tabs and
stacks
and popups and such based on a database representation of how the pieces
fit together. For each (partial) screen a user will see, there is an
automagically-handled persisted object (AHPO from here on) which
specifies
which class to load from which DLL, to what type of AHPO it is
conceptually
attached, its title, etc. Of course, it may be a container screen for
other
screens, in which case it has no DLL or class itself, just child
screens.
And you can have another variant that just points to a screen but with
slight changes. All this information about screens makes it possible for
many controls, based on their names, to automagically bind to the
appropriate data value.

Constants are held in the database as well. There are these items with a
unique number, a short name, a longer name, an ordering value, and
several
additional fields for extra information. They belong to some primary
group
of items, but they can belong to more than one group. In the additional
groups, the long name (but nothing else) can be overridden. These are
used
for various automagical dropdowns.

When first working with this framework, it seemed like it took care of a
whole lot of stuff for you, and the idea of separating out as much
functionality as data rather than code was appealing. Eventually,
though,
it becomes clear that the app spends so much time on framework magic
that
actual user interaction suffers. The system is painfully slow. It must
be
deployed on terminal services so that the system running the app can be
on
a gigabit link to the database server because so much data has to be
read
by the app to accomplish anything, and so much data gets persisted when
the
user does anything.

This is what it means to be overarchitected. The system is full of
beautiful design ideals, but doesn’t actually get the job done well.
Their
may be development and maintenance gains, but they are hidden by the
development costs (new developers require months of ramp-up time, which
can
also lead to staffing problems) and the cost of lost user productivity
as
the users wait for the system to respond.

–Greg

On Thursday 30 March 2006 18:00, Ben M. wrote:

The goal is not to “absorb Ruby into Java”. The goal is to allow even
closer interoperation than services allow. There is nothing to fear
in this and everything to be gained.

What I’m wondering about is, whether Rails will survive unscathed all
the changes it may have to endure in the name of close interoperation
with Java and enterprise readiness.

From my point of view, enterprise readiness is not the be-all and
end-all of every piece of software. There’s life outside the
enterprise. And there’s fully legitimate software development going on
outside the enterprise. My impression is that Rails has its focus there
and I’d like it to remain there.

Michael


Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/

I just stumbled across this thread, and figured I should inject a few
opinions. I am one of two active developers on JRuby, where my main
charge
has been the redesign of the core interpreter and planning for various
stages of compilation. I also recently got IRB and Rails’ generate
script
working, and I’m currently focused on optimizing the interpreter a bit
before we present JRuby at JavaOne. I’ll try to address some of the
issues
people have brought up:

  1. Java is slow
    I had thought this myth was entirely debunked, but as others have
    commented
    Java is nothing like slow. In certain scenarios there’s a bit more
    overhead
    than on “hand-optimized assembler code” but then you probably aren’t
    going
    to hand optimize a million lines of assembly either. Java is actually,
    in
    many cases, faster than compiled C code, owing to its ability to
    optimize
    and re-optimize code based on usage patterns. There’s never just one way
    to
    optimize a code path, and the mixed-mode compilation Java does while
    running
    allows it to exceed native code frequently. Take a look at any of the
    typical language shootouts or performance benchmarks. On equivalent
    algorithms, Java is extremely fast…in many, many cases far faster than
    the
    current Ruby code.

The following benchmark shows Java beating Ruby by an order of magnitude
in
almost every case, though it frequently uses more memory to do it:

http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lang=ruby&lang2=java15

Even if the benchmark is flawed, it’s hard to argue that an optimized
Ruby
implementation on the JVM would necessarily be slower.

  1. Enterprise is a loaded term that isn’t important

I agree. Enterprise has become as meaningless as SOA, Middleware, and
their
ilk. However, the concepts behind the word (or the concepts I’d like to
believe are behind the word) are very important.

“Enterprise Java” has come to mean many things to many people. If you
equate
Enterprise with Enterprise Java Beans, then you’re selling the platform
short. EJBs may have been initially compelling, but their verbosity and
complexity have doomed them to ridicule. Don’t write off the entire
platform, however. The Java Transaction API has made cross-request and
even
cross-server transactions trivial to handle. Enlisting n remote servers
into
a larger transaction is handled transparently. The Java Message Service
has
provided a simple, reliable, cross-platform and cross-server means of
handling asynchronous communications. It really “just works” and
provides
huge benefits for long-running processes and offline transactions. Java
Management Extensions, while not officially part of Enterprise Java,
provide
consistent, uniform remote administration and management capabilities,
along
with managed, monitored services throughout an application cluster. And
while we’re on that topic, clustering, failover, and session replication
within typical Enterprise Java clusters “just works” too. I won’t even
go
into JDBC, perhaps the most impressive cross-platform and cross-database
SQL
api that exists.

I am by day officially a “J2EE Architect”, though my eventual role has
me
mostly escorting other developers through the pain of writing J2EE
applications and trying to find better tools, frameworks, and patterns
to
make that process simpler. I feel all the typical pain of J2EE
developers,
and I agree there are bad areas…but don’t throw the baby out with the
bathwater.

  1. Bringing Ruby and Rails to Java will somehow corrupt Ruby and Rails

The goal of JRuby is to create a fast Ruby interpreter that looks,
feels,
and acts just like Ruby. We will not require any modifications to Ruby
(and
in fact we run with Ruby’s own lib/ruby/1.8 libraries), and we only
reimplement specific features where the Ruby equivalent doesn’t consider
Java’s capabilities or where Ruby implements those features in C. A
similar
argument goes for Rails: Rails must be able to run without modification
under JRuby, albeit behind a “mock CGI” Servlet that can simulate
running
with fastcgi and friends.

What we do hope to provide is a way to access Java’s good features from
within Rails. JDBC is an obvious match for ActiveRecord, and JTA can
provide
transaction support seamlessly. Once inside a J2EE cluster, we can also
enable replication and failover for Rails sessions and requests by
wiring
those subsystems into those provided by the cluster. We can wire JMS
into
available messaging libraries for Ruby, allowing Rails to submit jobs to
any
JMS-aware server (which ultimately could mean any messaging server,
since
most of them support JMS). The list goes on and on.

It is true, and must be accepted, that while Ruby the language is a
marvelous, beautiful thing, Ruby the platform still has some growing up
to
do. Unicode support is partial and inconsistent. Support for
locale-specific
calendars, messages, and behaviors is nowhere near what Java provides.
Integration with other languages and other platforms is sketchy at best.
Ruby simply lacks many features that would help it gain acceptance as
more
than “just another scripting language.” I’m certain Ruby will get
everything
it’s missing over time, but by putting Ruby and Rails on the JVM we may
be
able to have them now. Who knows, perhaps the APIs that develop out of
Ruby
on the JVM will filter back into the design process for future versions
of
Ruby.

  1. My plan for JRuby (though just one view of where we’re going)

I will try to lay out briefly the current plan for JRuby.

  • We are currently working very hard to get Rails running for a simple
    case.
    The generate script already works and generates usable code and
    configuration. The next step is getting Rails to handle a request. We
    currently get pretty far into that process before things bomb out, and
    expect to have it working by the end of this month.
  • JRuby is, despite Java’s speed, quite slow right now. The original
    author
    just did a simple port of Ruby’s C code to what it would look like in
    Java,
    and as a result many JVM features that could speed Ruby up were crippled
    or
    impossible to utilize. My work recently has been to completely rewrite
    and
    rewire the internals of JRuby to enable compilation to Java bytecode,
    full
    continuations support, tail-call optimization, and multi-VM (running
    multiple “Rubies” inside the same JVM). All of these will help improve
    performance, and we hope to exceed Ruby 1.8 performance at some point.

I would welcome any questions or comments. Our main goal with JRuby is
to
provide a real Ruby environment that happens to be running on the JVM,
and
to enable Ruby code to integrate with Java code whereever it is useful
to do
so. We would be as happy as you all if Ruby were to supplant Java as the
language-of-choice, and if JRuby helps further that goal…all the
better.

fwiw, the Jython effort – similar to JRuby – has had a good effect
on the Python community, especially in that it forced Guido von Rossum
to answer some pretty challenging questions about which features of
Python were language features and which were merely features of the
interpreter.

I code Java at work too, although I’d rather be using Rails, but it’s
true to some extent that with Java there is a baby in all that
bathwater.

I still think James McGovern’s on crack, though.

On 3/30/06, Bill W. [email protected] wrote:

working, and I’m currently focused on optimizing the interpreter a bit
optimize a code path, and the mixed-mode compilation Java does while running
Even if the benchmark is flawed, it’s hard to argue that an optimized Ruby
short. EJBs may have been initially compelling, but their verbosity and
while we’re on that topic, clustering, failover, and session replication

marvelous, beautiful thing, Ruby the platform still has some growing up to
4. My plan for JRuby (though just one view of where we’re going)
and as a result many JVM features that could speed Ruby up were crippled or
language-of-choice, and if JRuby helps further that goal…all the better.

http://lists.rubyonrails.org/mailman/listinfo/rails


Giles B.
www.gilesgoatboy.org

I have a builder template that renders a Java webstart jnlp file.
Right now I am creating the the jnlp file links like this:

link_to ‘Run’, :action => ‘jnlp’, :id => activity

Which creates links like this:

http://host.com/controller/jnlp/1

The action looks like this:

def jnlp
@headers[“Content-Type”] = “application/x-java-jnlp-file”
@headers[“Cache-Control”] = “public”
@activity = Activity.find(params[:id])
render :layout => false
end

Which implicitly calls the Builder view: jnlp.rxml

By setting the Content-Type in the http headers most browsers
correctly interpret the file “1” as a jnlp file and if Java is
installed start the webstart application. However FireFox on MacOS
seems to require that the file actually be served with the “.jnlp”
filename suffix.

So I’d like to instead create links like this:

http://host.com/controller/jnlp/1.jnlp

The general question is: how can I concatenate a static filename
suffix to a link?

Thanks!

Charles O Nutter wrote:

commented Java is nothing like slow. In certain scenarios there’s a bit
The following benchmark shows Java beating Ruby by an order of magnitude
I agree. Enterprise has become as meaningless as SOA, Middleware, and
transparently. The Java Message Service has provided a simple, reliable,

feels, and acts just like Ruby. We will not require any modifications to
can also enable replication and failover for Rails sessions and requests
sketchy at best. Ruby simply lacks many features that would help it gain

  • We are currently working very hard to get Rails running for a simple
    optimization, and multi-VM (running multiple “Rubies” inside the same
    JVM). All of these will help improve performance, and we hope to exceed
    Ruby 1.8 performance at some point.

I would welcome any questions or comments. Our main goal with JRuby is
to provide a real Ruby environment that happens to be running on the
JVM, and to enable Ruby code to integrate with Java code whereever it is
useful to do so. We would be as happy as you all if Ruby were to
supplant Java as the language-of-choice, and if JRuby helps further that
goal…all the better.

Beautifully put. (My day job is a bit like yours.)

Regarding your last point, I expect that JRuby will always benefit from
giving users the ability to drop down into Java, just as CRuby benefits
from allowing users to drop down into C.

thanks for your excellent work

Justin