forgive me monks, for i have sinned. This is my first confession

And what have you done my son?

I have impure thoughts on altering @ISA during runtime. Often.

Disclaimer: I am a newbie, to Perl and OOP - and largely dont understand the underlying concepts of how Perl works. I apologise if I cant provide a more informed case. This is what Im looking to get from posting this meditation.

So, as I understand it the @ISA is a bit of a hack onto Perl and possibly a conceptual faux pas in regard to "purer" OO languages. Using seems to be preferred to having the programmer directly manipulate @ISA, though of course, thats pretty much what does. I wonder that maybe this transparency is not a good thing, and that having a regular array of inheritence is a boon as oppose to a cheap trick.

Consider the obligitary Employee class. An Employee isa Person isa Mammal isa...

Of course, an Employee may also be a Musician, Artist, Trainspotter (in their spare time), or a Father, Husband, Buddy, or a Jerk, Hero, Nondescript-Bystander. There is no little tree diagram that can display this, because largely it is a matter of perspective. Once you have the perspective of the "viewer" (perhaps the user, or another object) then the tree of inheritence can organise itself. Its not the One True Tree of the Employee class - its just a perspective.

I dont yet subscribe to the "everything is an Object" type philosophy, but I can appreciate the power in thinking that way, and am enjoying the challenges of learning the methodology. However, most OO languages expect an objects lineage to be preordained by the God programmer with respect to whatever system he is working on. The fact an Employee isa Trainspotter is of little relevence to a Payroll program, and so in somewhat contrived ecosystems, there is no problem.

But what of other domains like AI, Neural Networks, Bioinformatics, Distributed computing, Peer-to-Peer?. The latter is more where my interest lies, and I often find that a clear line of relationship cannot be predefined. Sure, once there is a relationship you can make pretty tree diagrams, but that is again, based on perspective.

I am not a professional programmer or formally trained. I think of Perl more as an intillectual game than a tool for parsing log files. This is why I love Perlmonks - theres loads of theory up for grabs.

So, theorhetically, is manipulating an objects inheritence based on how it is currently being percieved, a worthwhile cause for meditation?

maybe there is somewhere I can read up on stuff like this?

Thankyou for any time

In reply to perspective and object-disorientation by Ctrl-z

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, 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, 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.