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

Re^5: Module provides both of functional interface and object-oriented one

by Anonymous Monk
on Feb 17, 2012 at 10:49 UTC ( #954505=note: print w/replies, xml ) Need Help??


in reply to Re^4: Module provides both of functional interface and object-oriented one
in thread Module provides both of functional interface and object-oriented one

If users choose OO interface, they shouldn't be able to call 'get_foo' method. How can I solve this problem?

I'm not very well versed in Perl's OO, so someone please correct me if I'm wrong, but I don't think you can forbid users from calling it. The only thing you can do is throw an error on unexpected arguments.

(There is a convention that a class's private methods' names begin with the underscore character, though.)

  • Comment on Re^5: Module provides both of functional interface and object-oriented one

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://954505]
help
Chatterbox?
[marioroy]: Hello all. After several attempts, am able to move forward and will soon release a Parallel:: ForkManager compatible MCE::Hobo:: Manager, also MCE::Hobo::Simple, and refactored MCE::Hobo engine supporting multiple instances. Wait works beautifully.
[marioroy]: MCE::Shared has been refined that it allows sharing Tie::File and hash objects containing {fh} key.
[marioroy]: It's taken so long to take Hobo to a new level. Threads-like and Parallel:: ForkManager management capaiblities.
[marioroy]: This will complete the 4 years in the making and likely time to move on to something els.
[marioroy]: s/els/else.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-05-26 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?