Re: Re: PEAR2 Coding standards, Autoloading and Namespaces

From: Date: Sat, 12 Apr 2008 22:48:50 +0000
Subject: Re: Re: PEAR2 Coding standards, Autoloading and Namespaces
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49784@lists.php.net to get a copy of this message
On Sat, Apr 12, 2008 at 10:43 PM, Jeff Moore <jeff@procata.com> wrote: > > On Apr 12, 2008, at 3:33 PM, Helgi Þormar Þorbjörnsson wrote: > > > > All this new Foobar() sounds really cute until you have long class names > > > > Well we can always do > > Use Really::Long:Class::Name as Short; We being the end user ? Then they have to know about this ;-) > > > $oRestoReview = Foo_Content::createType('RestaurantReview') > > ->addAttribute(new Foo_Attribute( > > array('name' => 'dateEaten', 'typeId' => > FOO_CONTENT_ATTR_TYPE_DATE))) > > ->addAttribute(new Foo_Attribute( > > array('name' => 'dishName', 'typeId' => > FOO_CONTENT_ATTR_TYPE_TEXT))) > > ->addAttribute(new Foo_Attribute( > > array('name' => 'overallRating', 'typeId' => > > FOO_CONTENT_ATTR_TYPE_FLOAT))) > > ->save(); > > > > > > This is an example from a real codebase taking this fun approach, > > start becoming messy soon, don't it ? > > > > Yeah, in my eyes, the problem is not class naming, but in using arrays > where simple parameters will do. > > > $oRestoReview = Foo_Content::createType('RestaurantReview') > ->addAttribute(new Foo_Date_Attribute('dateEaten')) > ->addAttribute(new Foo_Text_Attribute('dishName')) > ->addAttribute(new Foo_Float_Attribute('overallRating')) > ->save(); Aye, much better; I suppose what has come out of this discussion is that we have to improve our manual quite a bit to either point to appropriate sources or write something easily understandable for end developers, DI and all that. I'm still not convinced on every single of your points but I must admit you've won me over on some of the other points, lets see how that RFC business plays out. - Helgi

« previous php.pear.dev (#49784) next »