From: Florian Gilcher Date: 2008-05-29T03:48:00+09:00 Subject: Re: [ADV] New Beta of PickAxe3 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On May 28, 2008, at 8:01 PM, Dave Thomas wrote: > > On May 28, 2008, at 12:36 PM, Ryan Davis wrote: > >> >> On May 28, 2008, at 09:07 , Dave Thomas wrote: >> >>> 2. I'm being more opinionated when it comes to the ways you should >>> write code. So, for example, I'm pushing class inheritance way >>> back, and instead focusing on mixins as the preferred way of >>> structuring the sharing of functionality. (Obviously, inheritance >>> still has a place, but I'd like to see less instances of code like >>> "class Product < ActiveRecord::Base') >> >> How about you just push against nonsensical names like Base? >> >> class Product < ActiveRecord >> >> makes _plenty_ of sense by itself. :P > > class Product > include ActiveRecord > > end > > > makes even more... After all, a Product is not an ActiveRecord--it > uses the functionality. > > > Dave Actually - to extend the example - i really like the way DataMapper reads: === class Product include DataMapper::Persistence end === Uses Persistence, provided by DataMapper. That includes both the Task of the Module and the Source where it comes from. The main problem of ActiveRecord::Base is that Base is such a generic name. And it implies that every object that has to do with AR is based on it. Regards, Florian Gilcher -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkg9qLQACgkQJA/zY0IIRZYLvgCfUebEiapDHM9hW6IZAaj97ql0 45sAmQH6Z5LzxrFTfcx/huRrFp+XWWnV =6HvQ -----END PGP SIGNATURE-----