I have a very simple rule of thumb when it comes to OO: OO belongs in modules.

Modules are an intermediate level, where I build abstractions that will probably be re-used by several programs. There it makes sense, if only in order not to pollute the main namespace, to have a clean, opaque, interface and to wrap data structures and methods.

On the other and, at application level, I have seldom found the need to use OO design. On the contrary I often find that it would get in the way, as this is the level where most of the time abstractions hit the reality wall (I could have used an other expression involving stuff hitting revolving blades) and where good ole top down procedural design usually works well.

Of course this is not an absolute rule but I have found that it worked pretty well for me, with the added advantage of letting me be abstract, clean and happy with my code in OO modules while I know that application-level code is always a little messier and I have to live with it.


In reply to Re: Perl and Objects by mirod
in thread Perl and Objects, how do you resolve the two? by frankus

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.