On Oct 9, 2008, at 7:58 PM, S. Brent Faulkner wrote:
>
>> One of the things about the Rails code that people tend to frown upon
>> is the Base class. I was wondering if anyone ever considered  
>> replacing
>
> Can you point me in the direction of some discussion of what's wrong
> with the "Base class" that people "frown upon"?

I don't know of any articles that talk about this, I've mostly  
discussed it face-to-face.

And example of a project that changed their API is Datamapper, they  
went from:

   class Author < DataMapper::Base; end

To

   class Author; include DataMapper::Resource; end

> Just wondering, since I don't recall a problem off-hand?

There is no problem in the sense that tests are failing or a feature  
is broken. It's just weird to have a class with a non-descriptive name.

I get the feeling that the Base class was created because David wanted  
to create a namespace named ActiveRecord to prevent conflicts but also  
wanted to have something you could inherit from.  
ActiveRecord::ActiveRecord is weird, so it ended up being  
ActiveRecord::Base. I personally think ActiveRecord::Model or just  
ActiveRecord would have been a better name.

I see a lot of people using this as an idiom in other Ruby libraries  
and applications because they learn their first Ruby by developing a  
Rails applications, even though this idiom might not fit their project.

Manfred

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to