Your question could fill an entire book, in fact, it has
filled many books! While i consider
TheDamian's
OO Perl the BEST book out there on the
subject for OO Perl, i don't think i could honestly
recommend it to you
right now, simply because if
you didn't get perlboot or perltoot -
TheDamian's book
might send you screaming.
First, i don't recommend learning OOP for the first
time with Perl (and don't get me wrong - i love OO Perl).
The reason is because Perl was not designed as an OO
language in the first place. Java has a good model that is
very easy to comprehend - Perl is flexible and as such,
easier to get wrong.
Second, i don't feel that OO is the right solution for
every problem out there. There is a good reason that Perl
was not designed as an OO language in the first place -
you have to design a framework first. Personally, i don't
like having to do this for every single little utility
script that i write, especially the ones that are used
once and 'thrown away'.
So what is OOP all about? According to TheDamian (from
the afore mentioned book), benefits might be:
- simpler analysis methods
- domain-oriented approach to design
- cleaner and more compact code
- more robust implementations
- greater code modularity
- easier debugging
- more comprehensible interfaces
- better abstraction of software components
- less namespace pollution
- greater code reusability
- scalability of software
If you get the idea that OO is for LARGE projects that
involve TEAMS of programmers, then you are right. But you
as a single programmer on a small app can still benefit,
mainly with items 3,5,6, and 10 (just my opinions of
course).
I started learning OO back in 1996 and i consider myself a
little bit above an OO novice, just to give you
perspective. It takes a bit of time before you get that
'OO click'. Go back and re-read perltoot and perlboot, work
through the examples, eventually you will get it. If you
have some code that you wrote that you feel might benefit
from being 'ported' to OO, post it and one of us will
gladly show you how to do so. Examples are the best
learning tool, especially since there are so many buzz
words that float around the OO domain.
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
In reply to (jeffa) Re: OOP
by jeffa
in thread OOP
by Parham
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.