"Let's see...expert system stuff."
...these can be accessed as objects, returning...
"Oh, right. I was going to check that out anyway..."
Every time I try to use something, I'm told it's OO. I need to understand this, but to understand it I must do it.
"Well, let's look for an OOP tutorial in Perl."
And after many minutes of looking at one, I decided that Perl isn't a language one should learn OOP in...but many will attest you shouldn't learn it in C++ or Java.
I may just go try Ruby out and see if I can learn OOP while I learn Ruby. I understand the basics -- I believe -- but if I don't play around with it, I'll never really grok it.
Programming objects is a little more difficult, but if you read perlboot and perltoot, you'll have the basics.
I later wrote a TPJ article called "User's View of Object-Oriented Modules" which you might find helpful to get part of the picture on OOP. It's now available in CPAN as HTML::Tree::AboutObjects
The short story on OOP is this: it's about modeling things in terms of data structures whose insides you never touch directly, except with routines called methods. So you have a data structure ("object") that stands for the amortization table for a loan, or a node in a tree, or whatever, and everything you do with that, you do only with the documented routines ("methods"). You can write routines of your own to manipulate the objects, but they in turn use the documented methods.
Everything else about OOP -- inheritance, accessors, class data, the concept of "polymorphism", and even each particular language's syntax for method calls -- just derives incidentally from the basic concepts.
Practice, practice, practice, keep things simple, try things different ways, and read Damian's book.
Elemental
chaoticset on 2002-02-01T10:23:45
See, I think I understand the basic concept: Data structure(s) and ways to deal with said data structure(s) shrink-wrapped together in kind of an inseparable package. Said package can be duplicated, duplicated with frills, duplicated without certain things, duplicated just for the sake of having another one, etc.The trick now is fiddling around and seeing where my mental model of OO is somehow wrong, then playing around with it and some OO code until it's fixed.