Business application building with Ruby

I am contemplating a project, and I have a question:
What components would you use to build a business application in Ruby?

Suppose, you were asked to write a business application. Typical,
no-thrills business app. Reasonably small database, few dozen users (all
internal), some reporting functionality, couple of batch interfaces,
nothing fancy. To give an example, think about sales / stock control
system for a wholesale trader of electronic goods. Or vehicle tracking
system in a truck company. Or something similar.

Naturally enough, one would want to do it in Ruby :slight_smile:
But for a job like this, you need a certain set of technologies, namely:

1. A database
  Java world: Oracle, MySQL or another relational DB of your choice

2. Some way to persist domain objects and manage transactions
  Java world: entity EJBs, JDO, hand-coded DAOs, O/R <censored> mappers,
etc

3. An RPC (remote procedure call) mechanism for communication between
the front-end and the back-end (assuming that the front-end is a thick
GUI).
  Java world: session EJBs, servlets

4. A thick GUI
  Java world: Swing

5. A Web GUI
  Java world: JSP, XSLT, XMLC and all the other stuff

6. An asynchronous communications infrastructure
  Java world: message-driven EJBs

Doing the whole thing in Ruby is already experimental enough, so the
choice is limited to mature, production-grade stuff.

What would you use?

If this has been discussed before, I am sorry. Please point me to a
relevant thread in the archives.

Best regards
Alexey Verkhovsky

not that I did this, but I'd expect:

1. A database

postgresql with PL/ruby for the triggers :slight_smile:

2. Some way to persist domain objects and manage transactions
Java world: entity EJBs, JDO, hand-coded DAOs, O/R <censored> mappers,

active record and lafcadio seem to be the more mature O/R mapping
layers.
Madeleine and ruby/DBI may be good choice, too.

3. An RPC (remote procedure call) mechanism for communication between
the front-end and the back-end (assuming that the front-end is a thick
GUI).

druby (DRB) is widely used and included in the standard library

4. A thick GUI

fox and gtk bindings have been around for much time. maybe qt and wx
are nicer to you, but bindings are younger

5. A Web GUI

eruby, amrita

6. An asynchronous communications infrastructure

not sure here, but maybe Rinda (part of DRB) may be useful?

···

il Sun, 11 Jul 2004 07:27:23 +0900, Alexey Verkhovsky <alex@verk.info> ha scritto::

I do this regularly, though most of the work so far has tended to be much
more centric on web based applications.

1. A database
  Java world: Oracle, MySQL or another relational DB of your choice

MySQL

2. Some way to persist domain objects and manage transactions
  Java world: entity EJBs, JDO, hand-coded DAOs, O/R <censored>
mappers, etc

Kansas has been maturing wonderfully for my purposes for this.

3. An RPC (remote procedure call) mechanism for communication between
the front-end and the back-end (assuming that the front-end is a
thick GUI). Java world: session EJBs, servlets

drb. Works great.

4. A thick GUI
  Java world: Swing

TK, Qt, Fox

5. A Web GUI
  Java world: JSP, XSLT, XMLC and all the other stuff

I've use Iowa very successfully for this every day for a couple of years.

6. An asynchronous communications infrastructure
  Java world: message-driven EJBs

I am using Drb/Rinda/Tupleserver pretty effectively for this. No problems
with it at all so far.

Kirk

···

On Sun, 11 Jul 2004 07:27:23 +0900, Alexey Verkhovsky wrote

Thanks for the responses.

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

I thought, by convention, the first version that project developers
consider "production-grade" would be numbered 1.0. Am I wrong?

Best regards,
Alexey Verkhovsky

Result of executing this code:

class MyClass

  @instance_variable = "aaa"

  def MyClass::class_method
    puts @instance_variable
  end

end

MyClass.class_method

is "aaa".

I expected it to be "undefined variable".

What is the meaning of instance variable being accessible from a class
method? Which instance holds the value of that variable, if none has
been explicitly created yet?

Best regards,
Alexey Verkhovsky

Well, it's not really scary, since you can tweak them yourself. To me,
a 1.0 means that the product is feature-complete, relatively bug free,
and has been worked for scalability. Thus, what you can read from
these versions is that (1) people are using them, (2) they aren't
"feature-complete" according to the author, (3) they may have bugs,
and (4) they may not be as scalable as they should be.

For Ruwiki (not really part of the concepts you are examining), I have
a planned feature set, so Ruwiki won't reach 1.0 until those features
are in place.

-austin

···

On Sun, 11 Jul 2004 21:07:33 +0900, Alexey Verkhovsky <alex@verk.info> wrote:

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

I thought, by convention, the first version that project developers
consider "production-grade" would be numbered 1.0. Am I wrong?

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

1.0 means "we've reached all we wanted to do".
Known and widely used projects, such as openssl still have a versione
number under 1.0, yet they can absolutely be considered production
grade.

···

il Sun, 11 Jul 2004 21:07:33 +0900, Alexey Verkhovsky <alex@verk.info> ha scritto::

Thanks for the responses.

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

I thought, by convention, the first version that project developers
consider "production-grade" would be numbered 1.0. Am I wrong?

Alexey Verkhovsky wrote:

Thanks for the responses.

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

I thought, by convention, the first version that project developers
consider "production-grade" would be numbered 1.0. Am I wrong?

I think you're right, but some developers have forgotten that the point of
the version number is to be a sign to the users. They instead choose
numbers that have meaning to the developers but don't give the users any
sign of the importance of each version.

This is what happens when someone who's good at coding gets burdened with
release management.

···

--
Neil Stevens - neil @hakubi.us
"The world is a dangerous place to live; not because of the people who
are evil, but because of the people who don't do anything about it."
                                                 -- Albert Einstein(?)

In my case, with Kansas, it's because there are some features that I would
still like to put into the library before I get to a 1.0, and because my
documentation is poor. The 0.x versioning is more of a counter than
anything, right now.

Ditto with Iowa. I've been using it for production software for two years.
But there are still a couple things I want to add. I probably should just
cut to the chase and get a version 1.0 released, really.

Kirk Haines

···

On Sun, 11 Jul 2004 21:07:33 +0900, Alexey Verkhovsky wrote

Thanks for the responses.

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

I don't think there's any consensus as to what version numbers mean.
In the case of Lafcadio I can tell you that although it's not done,
it's also used on real systems handling real users and non-trivial
volume. (I believe the same can be said for ActiveRecord, too.)

The site where I mainly work gets 3m hits/month; that's backed by
Lafcadio. In fact I make sure to always have a stable bugfix branch
and a dev branch so users can choose their level of risk. I use the
stable bugfix branch for that main site.

Francis

Alexey Verkhovsky <alex@verk.info> wrote in message news:<1089461690.1011.10.camel@localhost.localdomain>...

···

Thanks for the responses.

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

I thought, by convention, the first version that project developers
consider "production-grade" would be numbered 1.0. Am I wrong?

Best regards,
Alexey Verkhovsky

What is the meaning of instance variable being accessible from a class

a class is an object and like any object it can have instance variable

method? Which instance holds the value of that variable, if none has
been explicitly created yet?

try this

svg% ruby -e 'class A; p self; @a = 12 end'
A
svg%

the instance variable will be defined for A

Guy Decoux

Alexey Verkhovsky wrote:

What is the meaning of instance variable being accessible from a class
method? Which instance holds the value of that variable, if none has
been explicitly created yet?

http://www.rubygarden.org/ruby?ClassInstanceVariables

:daz

Result of executing this code:

class MyClass

  @instance_variable = "aaa"

Here, @instance_variable is an instance variable of the class object MyClass.
See: http://www.rubygarden.org/ruby?ClassInstanceVariables

Everything is an object in Ruby, even classes.

You were probably looking for something like:
class MyClass
def initialize
   @instance_variable = "aaa"
#this means @instance_variable is an instance variable for
#objects of this class
end

  def MyClass::class_method
   puts @instance_variable
end
end

In which case MyClass.class_method will print 'nil', as expected.

HTH
- CT

···

On Sun, 25 Jul 2004 19:57:46 +0900, Alexey Verkhovsky <alex@verk.info> wrote:

  def MyClass::class_method
    puts @instance_variable
  end

end

MyClass.class_method

is "aaa".

I expected it to be "undefined variable".

What is the meaning of instance variable being accessible from a class
method? Which instance holds the value of that variable, if none has
been explicitly created yet?

Best regards,
Alexey Verkhovsky

Surely, if those other features can be honestly considered as the scope
of version 1.1.

There are many people who think that life is too short to touch anything
with version number less than 1.2.

Best regards,
Alexey Verkhovsky

···

On Sun, 2004-07-11 at 16:59, Kirk Haines wrote:

I probably should just
cut to the chase and get a version 1.0 released, really.

Kirk Haines wrote:

Thanks for the responses.

What should I make of the somewhat scary fact that most of the
components mentioned, including ALL persistence layer stuff, have
version numbers 0.something?

In my case, with Kansas, it's because there are some features that I would still like to put into the library before I get to a 1.0, and because my documentation is poor. The 0.x versioning is more of a counter than anything, right now.

Ditto with Iowa. I've been using it for production software for two years. But there are still a couple things I want to add. I probably should just cut to the chase and get a version 1.0 released, really.

Similar case with Blogtari. It runs rubyxml.com and ruby-doc.org, plus some number of other sites. There are still some issues, and some features I want to add, and some of the API may change, but it's basically stable.

The use of version number < 1 often means that some features are yet to be added, the API may change, or there are bugs to be worked out.

Code also often reaches the 1.0 state when the owner realizes he or she just doesn't have any more time to work on it, and simply wants to stamp it as "done."

For most libraries you really need to read the release notes to see what it does, and if it does it reliably. v0.x may mean "it doesn't do all it should, but what it does do it does well."

James

···

On Sun, 11 Jul 2004 21:07:33 +0900, Alexey Verkhovsky wrote

to start with, http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html

FreeBSD (perhaps the *BSDs in general) seem to have defined a standard
for what versioning should mean. not just release vs. current vs.
stable, but also their numbering.

so patterns exist to stablize what versioning should constitute.

i dislike dating because it doesn't actually tell you anything. a
next day release tells you as much as a version++ . but versioning
should _add_ relevent information to that.

-z

···

On Tue, 13 Jul 2004 10:37:23 +0900, Francis Hwang <sera@fhwang.net> wrote:

I don't think there's any consensus as to what version numbers mean.
In the case of Lafcadio I can tell you that although it's not done,
it's also used on real systems handling real users and non-trivial
volume. (I believe the same can be said for ActiveRecord, too.)

The site where I mainly work gets 3m hits/month; that's backed by
Lafcadio. In fact I make sure to always have a stable bugfix branch
and a dev branch so users can choose their level of risk. I use the
stable bugfix branch for that main site.

Francis

Alexey Verkhovsky <alex@verk.info> wrote in message news:<1089461690.1011.10.camel@localhost.localdomain>...

> Thanks for the responses.
>
> What should I make of the somewhat scary fact that most of the
> components mentioned, including ALL persistence layer stuff, have
> version numbers 0.something?
>
> I thought, by convention, the first version that project developers
> consider "production-grade" would be numbered 1.0. Am I wrong?
>
> Best regards,
> Alexey Verkhovsky

a class is an object

This much I understood before.

and like any object it can have instance variable

Aha...

To check my new understanding, @instance_variable in that example is a
variable of MyClass, the object.

Unlike things like @@static_class_attribute (that are also attributes
of MyClass, the object), @instance_variable is not accessible by objects
created by MyClass.new method.

Is that right? Experiments with IRB seem to confirm.

Alex

···

On Sun, 2004-07-25 at 14:13, ts wrote:

OK, got it. Thanks a lot to both of you.

Alex

···

On Sun, 2004-07-25 at 14:16, daz wrote:

http://www.rubygarden.org/ruby?ClassInstanceVariables

James Britt wrote:

For most libraries you really need to read the release notes to see what
it does, and if it does it reliably. v0.x may mean "it doesn't do all
it should, but what it does do it does well."

That's why version numbers less than one are meaningless. If the user has
to guess and read the documentation anyway then the version number conveys
no information to the user.

···

--
Neil Stevens - neil @hakubi.us
"The world is a dangerous place to live; not because of the people who
are evil, but because of the people who don't do anything about it."
                                                 -- Albert Einstein(?)

zuzu <sean.zuzu@gmail.com> wrote in message news:<a988e9f6040712185160cecf19@mail.gmail.com>...

> I don't think there's any consensus as to what version numbers mean.
> In the case of Lafcadio I can tell you that although it's not done,
> it's also used on real systems handling real users and non-trivial
> volume. (I believe the same can be said for ActiveRecord, too.)
>
> The site where I mainly work gets 3m hits/month; that's backed by
> Lafcadio. In fact I make sure to always have a stable bugfix branch
> and a dev branch so users can choose their level of risk. I use the
> stable bugfix branch for that main site.
>
> Francis
>
to start with, http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html

FreeBSD (perhaps the *BSDs in general) seem to have defined a standard
for what versioning should mean. not just release vs. current vs.
stable, but also their numbering.

so patterns exist to stablize what versioning should constitute.

I wasn't saying that patterns don't exist. I was saying that consensus
has not been reached.

Personally, whenever I'm checking out new libraries, I always look for
some sort of statement about whether it's alpha, beta, stable,
whatever. Sometimes that's a note on the web page, or a little tag on
the Sourceforge or Rubyforge page.

Is the Ruby community significantly out of step with the broader free
software community on this?

F.

···

On Tue, 13 Jul 2004 10:37:23 +0900, Francis Hwang <sera@fhwang.net> wrote: