Home  |  Linux  | Mysql  | PHP  | XML
From:Steve Bertrand Date:Mon Jun 29 12:16:26 2009
Subject:Re: AW: Using common object, without passing it around
> Steve Bertrand <steve@ibctech.ca> asked:
>> Can anyone suggest a perldoc or recommended practise that will help me
>> in regards to:
>>
>> I have numerous classes, all suited to a different object-type or
>> function.
>>
>> When I instantiate an object (all classes are under the same Module::
>> umbrella), I *think* what I want to do is create an 'error' object, but
>> I want that _specific_ instance of the Error object carried along with
>> ALL objects created during the time the life-cycle is in operation.
>
> You could use Class::Singleton [1] as a parent of your error handling class. That way, you can instantiate your error handling object in each of your classes in any order you like, and it'll always be the same object.

Nice! That looks like it's exactly what I'm after.

It will certainly save me from passing the object around as a parameter.

Thanks!

Steve


Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
HTML::Template, CGI::APP with the JSON + Jquery please help.
Re: script for shutdown remote machine
Re: help on example from "mastering algorithm with perl" on binarysearch
Re: floating point precision
Re: script to connect windows box from linux



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants