FAQ

Peter Scott wrote:
On Thu, 09 Aug 2007 18:49:59 +0200, Johan Vromans wrote:
The first question is what is wrong with base.

base was first released with perl 5.005. It has been in use for almost
10 years, and all of a sudden it is 'broken'?

Yes, it does not call the base class' import. But apparently noone
bothered.
It bothered me four years ago:

http://groups.google.com/group/comp.lang.perl.moderated/browse_thread/thread/e486d98d1b62e2e9/
I don't see it in that thread, but did anyone point out that there is a
completely valid reason *not* to call import() when using base.pm:

What do you do about multiple inheritance? Do you run import() on each
parent class? In what order? It's trivial to do your parent class
initialization in some other class method that is simply called directly
in the parent source file, ala

our $global_stash = $CLASS->init();

(with class methods to access that object's contents, rather than
groping for it directly in the child classes). There is no reason to
use import at all for this purpose (IMNSHO), and I see no reason to
change that.

I've stayed out of the discussion, mostly because I think the vast
majority of the people complaining about base.pm probably shouldn't be
using it in the first place. I'm with Johan: it isn't _that_ broken, I
personally have never had a problem with it (not that I use it all that
much), and I think the whole "design death march" is pretty silly...

My 2 cents

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 16 of 24 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedAug 8, '07 at 7:53p
activeAug 12, '07 at 8:16a
posts24
users12
websiteperl.org

People

Translate

site design / logo © 2019 Grokbase