Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: use of modules in special cases

by davido (Cardinal)
on Dec 21, 2019 at 22:33 UTC ( #11110489=note: print w/replies, xml ) Need Help??


in reply to use of modules in special cases

No, you should not use B;.

Child classes B1 and B2 handle all aspects of their inheritance from B. You should not need to use B unless you specifically want a B object.

There are a lot of strategies for ensuring that B1 and B2 implement the full interface needed for them to be treated polymorphically as children of B. Role as interfaces, pure-virtual base classes (not as common in Perl), base classes that throw exceptions if an accessor is called without having been overridden in a base, and others.


Dave

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2020-06-05 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?