Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: converting to a sub-class

by rhesa (Vicar)
on Oct 20, 2007 at 17:37 UTC ( [id://646196]=note: print w/replies, xml ) Need Help??


in reply to Re^2: converting to a sub-class
in thread converting to a sub-class

It's perfectly sane, don't be shocked :-)

The technique you're using is related to the Factory Pattern. It's quite an established idea.

Note that the hint to avoid hard-coding (parts of) the class name is good.

Replies are listed 'Best First'.
Re^4: converting to a sub-class
by Cagao (Monk) on Oct 20, 2007 at 17:47 UTC
    Ahh yes, the Factory pattern, I'd heard of that, isn't there 2 main ways of doing this sort of thing? Factory being one, what's the other?

    So that use of ->require, etc. looks fine then?

    I'll use __PACKAGE__ in future of course.

    if Person::Male shouldn't be a class, how else would it be done?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-19 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found