The latter, a seperate subclass for each breed. I'll try and explain why, and maybe it'll help make things a bit clearer (fingers crossed).

The Company and Company::Division classes are a kind of framework, which AcmeLtd and AcmeLtd::IT build upon to provide specific functionality, overriding methods to do so.

..........
..........

you know, at this point lots of stuff has just clicked into place in my head, and i've realised that by changing some other stuff around, I can get rid of the requirement to start with the Company object, and just start directly with AcmeLtd (which will of course inherit generic processing functionality from Company).

I think the problems i've had in trying to figure out how to structure this have come about because i don't have the AcmeLtd class in the system right now, and all the information that is going to go into that is pulled out of config files. When i decided to add the class in, i didn't analyse the change fully, and have been trying to do things the hard way as a result.

Thanks enormously for the above reply; in trying to answer it's made me think more about the situation, and helped me understand things better myself.

hossman++ # would have voted the above reply up if i could have


In reply to Re: Re: Re: •Re: inheritance and object creation by knew
in thread inheritance and object creation by knew

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.