Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: RFC US Region Module

by trs80 (Priest)
on Jul 06, 2003 at 19:19 UTC ( [id://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.
    dragonchild
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-28 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found