GuidoFubini:

As far as I'm concerned, data and code are a means to an end, but not something to focus on. I try to "blur my eyes" and find the *things*, and build my classes around those.

Trite, overused example: In a toy banking application, you could worry about balances and reports. Instead, I look for the *things* (account, customer) and then stick the code and data into the appropriate places. The stuff that doesn't easily go into a particular place is a flag: Either you didn't find all the things, or there are some rough edges that should be rethought to make things fit well, or it's just one of those things that doesn't fall into place. (I've never seen a large application where some stuff simply doesn't go into a nice place. Usually, it gets shoehorned into an 'Application' or 'Frobutility' class...)

--roboticus
(Who hasn't done any OO Perl, but has buckets & buckets of OO code for some other languages...)


In reply to Re: Philosophies of Objects by roboticus
in thread Philosophies of Objects by GuidoFubini

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.