[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Why dynamic languages for ActiveRecord..?

ypomonh

9/25/2007 3:21:00 PM

Icm having problems understanding why people prefer to implement the
ActiveRecord pattern in dynamic languages. Of course it is very
convenient if you donct have to worry about what type is your column,
but dynamic languages are more than that.

Do aval, higher-order functions, runtime alteration of object, closures,
etc. matter in the implementation of the ActiveRecord pattern..?



9 Answers

David A. Black

9/25/2007 4:16:00 PM

0

Phlip

9/25/2007 4:23:00 PM

0

> Ruby is a strongly, dynamically typed language. Strong because nothing
> ever changes its type, and dynamic because you can add features to

existing code, including getters and setters that make types appear dynamic.

--
Phlip

Phlip

9/25/2007 4:24:00 PM

0

David A. Black wrote:

> I'd say that the type of a Ruby object can change, but its class
> cannot. That's based on an understanding of the object's type as a
> kind of runtime snapshot of what the object can do and what messages
> it understands.

The inspiration there is Smalltalk, which is similarly strongly typed.

One common confusion among newbs is that weak typing == dynamic typing.

--
Phlip

David A. Black

9/25/2007 4:32:00 PM

0

Robert Dober

9/25/2007 4:47:00 PM

0

On 9/25/07, Phlip <phlip2005@gmail.com> wrote:
> David A. Black wrote:
>
> > I'd say that the type of a Ruby object can change, but its class
> > cannot. That's based on an understanding of the object's type as a
> > kind of runtime snapshot of what the object can do and what messages
> > it understands.
>
> The inspiration there is Smalltalk, which is similarly strongly typed.
I would not agree with this statement. Smalltalk strongly typed???
Furthermore there is Object>>becomes: (or was it a different class?)
which lets an object change its class too, so that makes a big
difference to Ruby.
BTW I had love to have Object#becomes in Ruby :)))

Cheers
Robert
--
I'm an atheist and that's it. I believe there's nothing we can know
except that we should be kind to each other and do what we can for
other people.
-- Katharine Hepburn

Phlip

9/25/2007 4:55:00 PM

0

Robert Dober wrote:

> > The inspiration there is Smalltalk, which is similarly strongly typed.

> I would not agree with this statement. Smalltalk strongly typed???

I learned that from this guy:

http://c2.com/cgi/wiki?J...

You are free to argue with him, but I ain't gonna!

--
Phlip

Jeremy Woertink

9/25/2007 5:15:00 PM

0

haha, nice! Especially the name.

On Sep 25, 10:02 am, "Jason Roelofs" <jameskil...@gmail.com> wrote:
> On 9/25/07, Robert Dober <robert.do...@gmail.com> wrote:
>
>
>
> > On 9/25/07, Phlip <phlip2...@gmail.com> wrote:
> > > David A. Black wrote:
>
> > > > I'd say that the type of a Ruby object can change, but its class
> > > > cannot. That's based on an understanding of the object's type as a
> > > > kind of runtime snapshot of what the object can do and what messages
> > > > it understands.
>
> > > The inspiration there is Smalltalk, which is similarly strongly typed.
> > I would not agree with this statement. Smalltalk strongly typed???
> > Furthermore there is Object>>becomes: (or was it a different class?)
> > which lets an object change its class too, so that makes a big
> > difference to Ruby.
> > BTW I had love to have Object#becomes in Ruby :)))
>
> > Cheers
> > Robert
> > --
> > I'm an atheist and that's it. I believe there's nothing we can know
> > except that we should be kind to each other and do what we can for
> > other people.
> > -- Katharine Hepburn
>
> require 'evil'
>
> http://eigenclass.org/hiki.rb?evil.rb+dl+an...


Phlip

9/29/2007 1:11:00 PM

0

ypomonh wrote:

> Philip, let me see if I got it straight:
>
> Ruby seems more well suited (eg. from Java) for implementing the
> ActiveRecord pattern, because its dynamic features make it easy/easier
> to implement (pretty much) any pattern. There is no inherent connection
> between the language and this _specific_ pattern.
>
> Am I correct?

"Yes and..."

That's consultant speak. We practice not saying "No but". (-;

The narrowest detail here is Java does not permit def my_column=, so its
code will always look ugly and resist elegance, especially when doing Active
Record.

In general, Ruby is more suited than Java for anything in Java's space,
except the crackerjack marketing to "enterprises". We are working on a bot
for that. (-;

--
Phlip


M. Edward (Ed) Borasky

9/29/2007 6:12:00 PM

0

Phlip wrote:
> "Yes and..."
>
> That's consultant speak. We practice not saying "No but". (-;
>
> The narrowest detail here is Java does not permit def my_column=, so its
> code will always look ugly and resist elegance, especially when doing
> Active Record.
>
> In general, Ruby is more suited than Java for anything in Java's space,
> except the crackerjack marketing to "enterprises". We are working on a
> bot for that. (-;

Would that be a "Yes bot"?

<ducking>