From: Phlip Date: 2007-09-26T00:40:02+09:00 Subject: Re: Why dynamic languages for ActiveRecord..? ypomonh wrote: > I'm having problems understanding why people prefer to implement the> ActiveRecord pattern in dynamic languages. Of course it is very> convenient if you don't have to worry about what type is your column,> but dynamic languages are more than that. You are describing a "soft" language, such as Perl, JavaScript, orsome aspects of BASIC. A variable can change its type based on itsenvironment. Ruby is a strongly, dynamically typed language. Strong because nothingever changes its type, and dynamic because you can add features to > Do �val, higher-order functions, runtime alteration of object, closures,> etc. matter in the implementation of the ActiveRecord pattern..? You are asking how a "Domain Specific Language" can integrate with ahost language of a different type. Ruby is procedural, and SQL isdeclarative. The answer is you use the host language's features towrite a declarative DSL. 'select foo from bar' becomesBar.find(:select => :foo) Both expressions are declarative, but the Ruby one can now enjoy thebenefits of the rest of Ruby. -- Phlip http://www.oreilly.com/catalog/9780596510657/ ^ assert_xpath http://tinyurl.com/yrc77g <-- assert_latest Model