It’s also possible that I have failed to understand some key points in the chapter.

not really,

this book is only teaching the simplest way to write "OOP" stuff in perl in 2003

Its not trying to teach you OOP/OOAD/what should be an object, what should be a method, should I provide accessors...

See http://perldoc.perl.org/perlootut.html#When-to-Use-OO

See •Re: OO Getters/Setters

See Perl Book OOPS / kind of effort required for learning OO perl ?!


Is OOP considered a universal subject that it could be discussed without any reference to a particular programming language? Are there books that you could recommend on the subject? Thank you. :)

yes its universal, when you search for "perl oo" or "language OO" you end up with very little discussion of WHY-oo only of "how oo", as in "bless {}" ... mechanics

The book you want is https://en.wikipedia.org/wiki/Object-oriented_Software_Construction

See Re: kind of effort required for learning OO perl ?!

See I dislike object-oriented programming in general

Damian Conway's ten rules for when to use OO


See your real problem is you're thinking of objects as bags of attributes.

you should be designing about responsibility, and the actions(methods) needed for such responsibility

why should a Fruit be an object ? Why should a Fruit have a color and name attribute? Why should color/name have getters/setters?

A Fruit should be an object that does stuff, like describe itself, it should have a describe method that returns a description like "red apple"

See How do I go from procedural to object oriented programming?

See High level OOP query


In reply to Re: OOP's setter/getter method - is there a way to avoid them? ( what should be an object and what should it do) by Anonymous Monk
in thread OOP's setter/getter method - is there a way to avoid them? by tiny_monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.