Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Inheritance: the root of the problem

by xmath (Hermit)
on Aug 04, 2006 at 16:58 UTC ( #565703=note: print w/replies, xml ) Need Help??


in reply to Inheritance: the root of the problem

Inheritance typically accomplishes two things:

1. interface inheritance, saying you support every operation that your super supports. This is probably better accomplished with interfaces, either explicit (like Java) or implicit (does it support these methods? good enough.)

2. implementation inheritance, reusing the parent's implementation of various stuff because the same applies to you. This is can be done via delegation, where you create the parent object, and "merge" some or all of its methods into the "subclass" object you're creating. If there's a need for the parent to call into the child, then appropriate closures should be passed upwards during construction.

Making a nice syntax for all this is probably the biggest challenge :-)

UPDATE: You might also want to look at how the E programming language, which does closure-based OO, handles delegation.

  • Comment on Re: Inheritance: the root of the problem

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://565703]
help
Chatterbox?
LanX is on a protloose
[shmem]: protloose? can't parse that
[choroba]: neither can I
[choroba]: and the first Google hit is tagged "human feces" :-o
[choroba]: oh, missed the double o
[shmem]: "brotlos"?
[shmem]: heavy protein discharge?

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-08-17 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (286 votes). Check out past polls.

    Notices?