[Dbix-class] new() and initialize()

Matt S Trout dbix-class at trout.me.uk
Sat Dec 3 03:49:01 CET 2005


On Wed, Nov 30, 2005 at 07:28:12PM -0500, Vsevolod (Simon) Ilyushchenko wrote:
> Hi,
> 
> I've upgraded to 0.04, but the problem with new() and initialize() that 
> I had persists. I though that by putting my model superclass in the 
> begininng of ISA, I'd be able to override new() to perform 
> class-specific initialization.
> 
> However, when relationships are followed, new instances are blessed in 
> DBIx::Class::Row::_row_to_object - new() is never called! I can probably 
> override this method, but that would we *wrong*. What else can I do?

I've probably asked this before, but what are you trying to achieve here?

Can't any non-persistent information be lazily generated at run-time? If
not, why isn't it persisted already?

(_row_to_object should soon morph into a public inflation interface as I
refactor, but for the moment it's probably not a good target).

-- 
     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