Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: OO Baggage

by extremely (Priest)
on Jan 16, 2001 at 03:43 UTC ( [id://52108]=note: print w/replies, xml ) Need Help??


in reply to OO Baggage

In short, an object is nothing more than a structure of data that has a "name". The compiler uses that name to find a set of subroutines, methods, that are assured of working with that structure. So, no, the methods aren't bootstrapped into memory once for each object, they are just subroutines that perl knows work well with a data structure.

Honestly, all the jargon makes it a lot more mysterious than it really is but you need the jargon to talk about the subtleties of it all.

Class
a data structure blueprint and a set of subroutines that know how to work on that structure.
Method
a subroutine that knows how to work on a particular data structure.
Object
a chunk of real data that follows a blueprint and has a field in it that knows what Class it belongs to.
Instantiate
to use the blueprint in a Class to create a new, filled-out data structure.
Call
look up a subroutine by it's method name in the Class that the object belongs to.
Inherit
borrow general purpose routines from a "parent" that work on parts of your structure.

HTH. There is a lot more to it but that is a sorta ok mapping to the world you are likely to have been working in. Others, help me out if I've "translated" that in some evil way that will only hurt him later, please.

--
$you = new YOU;
honk() if $you->love(perl)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found