Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Object Orientation should simply be seen as one tool in the toolbelt.

I think that it excels at a few things:

  • Providing a simple interface to a subject with complex internals.
  • Providing a degree of autonomy to entities.
  • Making a new entity act or be acted upon in a way that seems already familiar (tied variables, overloaded operators, etc.).
  • Giving data an inherent context (I'm not talking about context in the Perlish usage, but rather, context in the conceptual sense), and a standardized means of manipulation.
  • Extensibility through inheritance.
  • Multiple instances! (almost forgot that one)

Of course that's not a comprehensive list, and some of those notions can be addressed without OO. But OO can provide a convenient means to those ends.

For those reasons, I happen to like using CPAN and core modules that have an OO design better than ones that don't; they just seem to be easier to use once the OO notation is understood.

But OO design can also be overkill, and may add to confusion if not well thought-out. But the same can be said of many tools. Use a screwdriver for screws, and a hammer for nails. And if you need to chop wood, a chainsaw is handy. But don't try to drive nails with chainsaws; you'll get hurt. Use OO when it makes sense, when it simplifies design, when it is helpful. Bag it when some other approach is less of a headache.


Dave


In reply to Re: The world is not object oriented by davido
in thread The world is not object oriented by tilly

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found