One school of thought is that anything that is identifiable outside the context of another object is itself an object. A customer order in one sense is nothing but an old shopping cart. It reflects the contents of a shopping cart from a previous visit, and it probably extends the amount of information normally associated with a shopping cart.

So, as you can see, an order is a shopping cart with some extra info. Common to the school of thought that I am describing (in a limited sense, since OO is not an entirely easy concept to describe within the constraints of this node) is the use of is a and has a descriptions in as many places as possible. By designing this information, a clearer picture as to what objects are "super-objects" and what objects are "detail-objects" will emerge. The "super-objects" will contain the necessary code to meet basic needs and the "detail-objects" will contain the majority of the code in relation to that object. You'll probably override/overload some of the functionality in the "super-objects" when you get to the "detail-objects".

I had a pretty decent book in my OO class at school written by Timothy Budd called An Introduction to Object-Oriented Programming, which covers a good portion of theory. I thought it was useful, albeit the book lacks Perl implementation.

ALL HAIL BRAK!!!


In reply to Re: OO Design Reference? by PsychoSpunk
in thread OO Design Reference? by sz

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.