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

Re^2: Moose::Meta programming and derivative classes

by JayBonci (Curate)
on May 01, 2017 at 00:33 UTC ( [id://1189229]=note: print w/replies, xml ) Need Help??


in reply to Re: Moose::Meta programming and derivative classes
in thread Moose::Meta programming and derivative classes

Hey there choroba, thanks for getting back to me.

So to clear up a few things. First, thanks for the tip about strict and warnings. I also meant methods, as you implied.

I guess what I'm considering is that I want to be able to create additional classes out of skeletons of other classes that are set at use() time if possible. So when I use MyApp::Object, I also want MyApp::Object::Collection to be available as an object that could get returned, and it is built via convention. It seems like I could create an on-the-fly class and store that to make instances of it when I return something that would be a collection, and maybe that is the right way to do it, but that feels strange to me when you could just store traditional stuff in the symbol table. I'm academically exploring how I can use meta programming to reduce having to generate a bunch of classes at use time and avoid potential errors of copy and paste boilerplate stuff.

Thanks again!



    --jaybonci

Replies are listed 'Best First'.
Re^3: Moose::Meta programming and derivative classes
by Anonymous Monk on May 01, 2017 at 17:38 UTC
    "I'm academically exploring how I can use meta programming to reduce having to generate a bunch of classes at use time ..."

    You simply ... don't. Classes are just containers, they don't actually do anything. It is their METHODS that do the work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-03-28 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found