[Dbix-class] Re: new name for "as"

Matt S Trout dbix-class at trout.me.uk
Fri Nov 3 14:06:43 GMT 2006


Steven Mackenzie wrote:
> Matt S Trout wrote:
>> Steven Mackenzie wrote:
>>> 'accessor_name' isn't really appropriate becuase the docs state that no
>>> actual accessor is created, and you must use ->get_column('<name>'.)
>>> Although it would seem sensible to change the behaviour to create the
>>> accessor wouldn't it? Is there a reason that no accessor is created at
>>> the moment?
>> Yes, because generating random accessors all over your classes without
>> you asking for them would be a horrific bug source.
> Spot clashes at compile/load time then it wouldn't be too bad -- after
> all you create accessors for all the "real" column names with the same
> risk. Accessors are a valuable convenience in the API.

Um.

Arbitrary ->search calls can be made at run-time, possibly built up 
programmatically from user input.

And if you already know which names you're going to use, you can happily 
create classes with those as accessors yourself and specify them using 
$rs->result_class($class);

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list