And right back at ya :)
- This problem came into existence while converting classical OO to Moose. The old code used dynamic multiple inheritance to try (but not succeed completely) to implement, what was later explained to me, the functionality of roles. Unfortunately, the way it was implemented meant that once features were added to an instance using multiple inheritance, all instances of that class got those features (instead of just the single instance).
- There are currently about 9 attributes in the Parent class, and an unspecified number in various child-classes. The fact that new child-classes (offering new roles) can be added with an arbitrary amount of (new) attributes (plus the fact that I can't be arsed to write 9 builder functions that return empty data :)) calls for the dynamic creation of builder functions (imho :P).
From the Moose's mouth:
http://search.cpan.org/~drolsky/Moose/lib/Moose/Manual/Construction.pod
The BUILD method is called after an object is created.
...
The interaction between multiple BUILD methods in an inheritance hierarchy is different from normal Perl methods. You should never call $self->SUPER::BUILD.
Moose arranges to have all of the BUILD methods in a hierarchy called when an object is constructed, from parents to children.
From which I concluded that first a parent object would be created and BUILD called, then the inheritance would kick in and the child's BUILD would be called.
Anyway, given the current situation, I'd need to dynamically figure out how $self relates to __PACKAGE__ and create the appropriate builder functions (if they don't exist already). Or something completely different.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.