Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: RFC US Region Module

by trs80 (Priest)
on Jul 06, 2003 at 19:19 UTC ( #271808=note: print w/replies, xml ) Need Help??

in reply to Re: RFC US Region Module
in thread RFC US Region Module

If I leave it OO don't I avoid the issue of the function name collision you mention? While I agree there is no current or compelling reason for this module to be OO it does seem to work easily enough to provide the functionality I need. Would I see benefits from it being non-OO?

The DATA read has been moved outside of the new since that was the wrong spot for it and subsequent object creations would have resulted in an empty hash ref being assigned to $self.

Of the names I felt the Geography namespace would be best, but I am still struggling with the Census::Regions / Regions::Census issue for these reasons:
  1. Geography::US::Regions would leave the name space open for additional Region separation specific modules each named for their source, as in this case Census
  2. Geography::US::Census seems limiting to me because the number of Geography based concepts that would deal with Census seem limited.

Thanks for the feedback.

Replies are listed 'Best First'.
Re: Re: Re: RFC US Region Module
by pfaut (Priest) on Jul 06, 2003 at 19:31 UTC
    If I leave it OO don't I avoid the issue of the function name collision you mention?

    Perl uses packages to implement OO but packages don't necessarily imply OO. Packages provide namespaces that help avoid function and variable name collisions. Those functions don't necessarily have to be written in an OO fashion, though.

    90% of every Perl application is already written.
Re^3: RFC US Region Module
by Aristotle (Chancellor) on Jul 07, 2003 at 00:07 UTC
    The collisions are already avoided by writing something like Geography::US::Census::Regions::state, which is admittedly clumsy. You can use alternative exporters such as Exporter::Tidy to provide your users the option to choose a prefix or alias of their preference for the exported functions. OO is the wrong tool here.

    Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://271808]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-09-19 19:44 GMT
Find Nodes?
    Voting Booth?

    No recent polls found