SlideShare a Scribd company logo
1 of 18
Download to read offline
Meta Moose
Tuesday, September 18, 12
About Me

                            Ynon Perek
                            me@ynonperek.com
                            This keynote is available at:
                            http://ynonperek.com




Tuesday, September 18, 12
Meta Who


                            Person                Keynote
                                       has many




Tuesday, September 18, 12
Meta Who

              Meta-Person                         Meta-Keynote


                            Person                   Keynote
                                       has many




Tuesday, September 18, 12
Meta Class


                            What can my class do ?
                            What does my class know ?




Tuesday, September 18, 12
Meta Zombie

          package main;
          my $z = Zombie->new;

          while (chomp ( my $that = <> ) ) {
              my $m = Zombie->meta->find_method_by_name("eat_${that}");
              $m->execute($z) if $m;
          }




Tuesday, September 18, 12
Real Zombies...




Tuesday, September 18, 12
Useful Meta

                            MooseX::HasDefaults::RO
                            Assign a meta-role to every attribute
                            which adds:
                            is => ‘ro’
                            Uses _process_options



Tuesday, September 18, 12
Useful Meta

                            MooseX::FollowPBP
                            Automatically set reader and writer to
                            get_name and set_name




Tuesday, September 18, 12
Useful Meta

                            MooseX::Privacy
                            Private Methods Using
                            meta




Tuesday, September 18, 12
MooseX::Privacy
                use MooseX::Privacy;

                has config   =>   (
                    is       =>   'rw',
                    isa      =>   'Some::Config',
                    traits   =>   [qw/Private/],
                );


                private_method foo => sub {
                    return 23;
                };




Tuesday, September 18, 12
A few more

                                           package MyApp;
                                           use MooseX::Singleton;

                       MooseX::Singleton
                                           package main;
                       MooseX::YAML        my $instance = MyApp->instance;
                                           my $same = MyApp->instance;




Tuesday, September 18, 12
Meta Me
Tuesday, September 18, 12
What I Had

                       Quote      Video     Keynote




Tuesday, September 18, 12
What I Need

                       Quote       Video     Keynote



                     admin/        admin/    admin/
                      quote         video    keynote



Tuesday, September 18, 12
The Meta Way
        has 'name',        isa => 'Str', required => 1, in_db => 1,
           form_opts => { type => 'text_field'};

        has 'description', isa => 'Str', required => 1, in_db => 1,
           form_opts => { type => 'textarea_field' };

        has 'url',         isa => 'Str', required => 1, in_db => 1,
           form_opts => { type => 'text_field'};

        has 'category',    isa => 'Str', default => '', in_db => 1,
           form_opts => {
              type => 'select_field',
              options => YPCourse::Category->get_categories,
           };




Tuesday, September 18, 12
Q&A




Tuesday, September 18, 12
Photos From
                        zombies (slide 7): http://www.flickr.com/
                        photos/cwsteeds/4701084069/
                        gate (slide 10): http://
                        www.photoxpress.com/stock-photos/rust/
                        chains/lock/2544705
                        everything else: http://123rf.com



Tuesday, September 18, 12

More Related Content

More from Ynon Perek

Mobile Devices
Mobile DevicesMobile Devices
Mobile Devices
Ynon Perek
 

More from Ynon Perek (20)

09 performance
09 performance09 performance
09 performance
 
Mobile Web Intro
Mobile Web IntroMobile Web Intro
Mobile Web Intro
 
Qt multi threads
Qt multi threadsQt multi threads
Qt multi threads
 
Vimperl
VimperlVimperl
Vimperl
 
Syllabus
SyllabusSyllabus
Syllabus
 
Mobile Devices
Mobile DevicesMobile Devices
Mobile Devices
 
Network
NetworkNetwork
Network
 
Architecture app
Architecture appArchitecture app
Architecture app
 
Cryptography
CryptographyCryptography
Cryptography
 
Unit Testing JavaScript Applications
Unit Testing JavaScript ApplicationsUnit Testing JavaScript Applications
Unit Testing JavaScript Applications
 
How to write easy-to-test JavaScript
How to write easy-to-test JavaScriptHow to write easy-to-test JavaScript
How to write easy-to-test JavaScript
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and Ruby
 
Introduction To Web Application Testing
Introduction To Web Application TestingIntroduction To Web Application Testing
Introduction To Web Application Testing
 
Accessibility
AccessibilityAccessibility
Accessibility
 
Angularjs
AngularjsAngularjs
Angularjs
 
Js memory
Js memoryJs memory
Js memory
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design Patterns
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
JavaScript DOM Manipulations
JavaScript DOM ManipulationsJavaScript DOM Manipulations
JavaScript DOM Manipulations
 
Mongodb Intro
Mongodb IntroMongodb Intro
Mongodb Intro
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Metamoose

  • 2. About Me Ynon Perek me@ynonperek.com This keynote is available at: http://ynonperek.com Tuesday, September 18, 12
  • 3. Meta Who Person Keynote has many Tuesday, September 18, 12
  • 4. Meta Who Meta-Person Meta-Keynote Person Keynote has many Tuesday, September 18, 12
  • 5. Meta Class What can my class do ? What does my class know ? Tuesday, September 18, 12
  • 6. Meta Zombie package main; my $z = Zombie->new; while (chomp ( my $that = <> ) ) { my $m = Zombie->meta->find_method_by_name("eat_${that}"); $m->execute($z) if $m; } Tuesday, September 18, 12
  • 8. Useful Meta MooseX::HasDefaults::RO Assign a meta-role to every attribute which adds: is => ‘ro’ Uses _process_options Tuesday, September 18, 12
  • 9. Useful Meta MooseX::FollowPBP Automatically set reader and writer to get_name and set_name Tuesday, September 18, 12
  • 10. Useful Meta MooseX::Privacy Private Methods Using meta Tuesday, September 18, 12
  • 11. MooseX::Privacy use MooseX::Privacy; has config => ( is => 'rw', isa => 'Some::Config', traits => [qw/Private/], ); private_method foo => sub { return 23; }; Tuesday, September 18, 12
  • 12. A few more package MyApp; use MooseX::Singleton; MooseX::Singleton package main; MooseX::YAML my $instance = MyApp->instance; my $same = MyApp->instance; Tuesday, September 18, 12
  • 14. What I Had Quote Video Keynote Tuesday, September 18, 12
  • 15. What I Need Quote Video Keynote admin/ admin/ admin/ quote video keynote Tuesday, September 18, 12
  • 16. The Meta Way has 'name', isa => 'Str', required => 1, in_db => 1, form_opts => { type => 'text_field'}; has 'description', isa => 'Str', required => 1, in_db => 1, form_opts => { type => 'textarea_field' }; has 'url', isa => 'Str', required => 1, in_db => 1, form_opts => { type => 'text_field'}; has 'category', isa => 'Str', default => '', in_db => 1, form_opts => { type => 'select_field', options => YPCourse::Category->get_categories, }; Tuesday, September 18, 12
  • 18. Photos From zombies (slide 7): http://www.flickr.com/ photos/cwsteeds/4701084069/ gate (slide 10): http:// www.photoxpress.com/stock-photos/rust/ chains/lock/2544705 everything else: http://123rf.com Tuesday, September 18, 12