Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: On the Improvement of Exegesis 12

by kelan (Deacon)
on Apr 19, 2004 at 14:23 UTC ( #346303=note: print w/replies, xml ) Need Help??


in reply to Re: On the Improvement of Exegesis 12
in thread On the Improvement of Exegesis 12

Much of A12 is, as you pointed out, about implementation. To us mere mortals, it's the kind of thing that's interesting to know, but really I didn't try too hard to understand the dispatching details. All I need to know is that I can write methods with the same name and different signatures and it will work. And I barely more than skimmed any paragraph that mentioned an ALLCAPS sub. Things like BUILD, BUILDALL, AUTOMETH, etc., are just kind of vague things that do stuff I probably won't need to change in the near future, if ever.

Roles are more for the Class Writer than the User. They're just little bits of abstracted behavior that you can throw into classes that need the behavior. They're useful to get away from writing lots of abstract classes that just contain behavior and then doing multiple inheritance all over.

As a Class User, you pretty much just do what you do now. As long as the Writer has done their job correctly, you just do:

use SomeClass; my $obj = SomeClass.new; $obj.something; # etc.
In fact, even deriving from a class that uses Roles doesn't require knowing about them. To your derived class, any methods implemented as Roles in the base class look like any other derived method to your class.

I'm not too sure about Traits, myself, so I'll refrain from commenting on them at all. A good example involving what Traits are and how to use them would be my request for E12.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://346303]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2022-09-30 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?