logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: ANNOUNCE: CGI::Application::Plugin::LogDispatch: msg#00141

Subject: Re: ANNOUNCE: CGI::Application::Plugin::LogDispatch
On 2004-12-13, Dan Horne <dan.horne-mBdk2+nyEI5BWQWeTLFoew@xxxxxxxxxxxxxxxx> 
wrote:
>
>     $self->{logger} = get_logger("cms");

This breaks the principle of encapsulation of Object Oriented
Programming. A benefit of objects is that they hide wants inside them. 

Here you are going through a 'back door' rather than using the
advertised interface of methods provided by the C::A object. 

That's why someone else suggested using param() instead, and that's why
people write simple plug-ins which make simple wrappers that add valid
methods to the CGI::App object, extending the objects facade rather than
working around it. 

The issue is as much philosophical as anything. In practice, I don't
think you would run into too many 'gotchas' with this approach. It's
just not considered 'clean' and 'pure'.

The plug-ins themselves actually often break the encapsulation principle
in the same way. The difference is that the user is shielded from this.
If two plug-ins ever caused a conflict because of this, it could be
resolved by changing the plugin's internal code, rather than having to
change user level code in N pllaces. 

    Mark

-- 
http://mark.stosberg.com/ 


---------------------------------------------------------------------
Web Archive:  
http://www.mail-archive.com/cgiapp-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: 
cgiapp-unsubscribe-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx
For additional commands, e-mail: 
cgiapp-help-svx1JCNWaqPWzzAP45jFb16hYfS7NtTn@xxxxxxxxxxxxxxxx





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>