Your SlideShare is downloading. ×
0
Outline
             Introduction
       Seeing is believing
                   Mouse
                 The End




  Moooo...
Outline
                           Introduction
                     Seeing is believing
                                 ...
Outline
                          Introduction
                    Seeing is believing   What’s Moose?
                   ...
Outline
                          Introduction
                    Seeing is believing   What’s Moose?
                   ...
Outline
                          Introduction
                    Seeing is believing   What’s Moose?
                   ...
Outline
                          Introduction
                    Seeing is believing   What’s Moose?
                   ...
Outline
                          Introduction
                    Seeing is believing   What’s Moose?
                   ...
Outline
                          Introduction
                    Seeing is believing   What’s Moose?
                   ...
Outline
                            Introduction
                      Seeing is believing   What’s Moose?
               ...
Outline
                           Introduction
                     Seeing is believing   What’s Moose?
                 ...
Outline
                           Introduction
                     Seeing is believing   What’s Moose?
                 ...
Outline
                           Introduction
                     Seeing is believing   What’s Moose?
                 ...
Outline
                           Introduction
                     Seeing is believing   What’s Moose?
                 ...
Outline
                           Introduction
                     Seeing is believing   What’s Moose?
                 ...
Outline
                           Introduction
                     Seeing is believing   What’s Moose?
                 ...
Outline    Let’s Compare!
                           Introduction    Attributes - has
                     Seeing is belie...
Outline    Let’s Compare!
                         Introduction    Attributes - has
                   Seeing is believing...
Outline    Let’s Compare!
                             Introduction    Attributes - has
                       Seeing is b...
Outline    Let’s Compare!
                            Introduction    Attributes - has
                      Seeing is bel...
Outline    Let’s Compare!
                              Introduction    Attributes - has
                        Seeing is...
Outline    Let’s Compare!
             Introduction    Attributes - has
       Seeing is believing   Roles - with
        ...
Outline    Let’s Compare!
                             Introduction    Attributes - has
                       Seeing is b...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                               Introduction    Attributes - has
                         Seeing ...
Outline    Let’s Compare!
                       Introduction    Attributes - has
                 Seeing is believing   R...
Outline    Let’s Compare!
                       Introduction    Attributes - has
                 Seeing is believing   R...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
                          Introduction    Attributes - has
                    Seeing is believi...
Outline    Let’s Compare!
                          Introduction    Attributes - has
                    Seeing is believi...
Outline    Let’s Compare!
                           Introduction    Attributes - has
                     Seeing is belie...
Outline    Let’s Compare!
                        Introduction    Attributes - has
                  Seeing is believing  ...
Outline    Let’s Compare!
                       Introduction    Attributes - has
                 Seeing is believing   R...
Outline    Let’s Compare!
                            Introduction    Attributes - has
                      Seeing is bel...
Outline    Let’s Compare!
                          Introduction    Attributes - has
                    Seeing is believi...
Outline    Let’s Compare!
                              Introduction    Attributes - has
                        Seeing is...
Outline    Let’s Compare!
                            Introduction    Attributes - has
                      Seeing is bel...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
             Introduction    Attributes - has
       Seeing is believing   Roles - with
        ...
Outline    Let’s Compare!
             Introduction    Attributes - has
       Seeing is believing   Roles - with
        ...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
                  Introduction    Attributes - has
            Seeing is believing   Roles - wit...
Outline    Let’s Compare!
                           Introduction    Attributes - has
                     Seeing is belie...
Outline
                     Introduction    What’s Mouse?
               Seeing is believing   Why?
                     ...
Outline
                            Introduction    What’s Mouse?
                      Seeing is believing   Why?
       ...
Outline
                               Introduction    What’s Mouse?
                         Seeing is believing   Why?
 ...
Outline
                            Introduction
                      Seeing is believing
                               ...
Outline
                            Introduction
                      Seeing is believing
                               ...
Outline
                            Introduction
                      Seeing is believing
                               ...
Outline
                          Introduction
                    Seeing is believing
                                Mou...
Outline
                          Introduction
                    Seeing is believing
                                Mou...
Outline
                         Introduction
                   Seeing is believing
                               Mouse
...
Outline
                         Introduction
                   Seeing is believing
                               Mouse
...
Outline
                         Introduction
                   Seeing is believing
                               Mouse
...
Outline
                       Introduction
                 Seeing is believing
                             Mouse
      ...
Upcoming SlideShare
Loading in...5
×

use Moose talk in beijing workshop 2008

997

Published on

This is an introduction for Moose in beijing perl workshop 2008 on 08 Nov.

Published in: Technology, Spiritual
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
997
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
16
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "use Moose talk in beijing workshop 2008"

  1. 1. Outline Introduction Seeing is believing Mouse The End Mooooooooooooooooose sunnavy@bestpractical.com November 08, 2008 sunnavy@bestpractical.com Mooooooooooooooooose
  2. 2. Outline Introduction Seeing is believing Mouse The End Introduction What’s Moose? Seeing is believing Let’s Compare! Attributes - has Roles - with Method Modifiers Other Methods Mouse What’s Mouse? Why? Mouse is not enough in future? The End sunnavy@bestpractical.com Mooooooooooooooooose
  3. 3. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose is not NOT a cow sunnavy@bestpractical.com Mooooooooooooooooose
  4. 4. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose is not NOT a cow NOT contain any melamine sunnavy@bestpractical.com Mooooooooooooooooose
  5. 5. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose is not NOT a cow NOT contain any melamine NOT Perl 6 sunnavy@bestpractical.com Mooooooooooooooooose
  6. 6. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose is not NOT a cow NOT contain any melamine NOT Perl 6 NOT just a toy sunnavy@bestpractical.com Mooooooooooooooooose
  7. 7. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose is not NOT a cow NOT contain any melamine NOT Perl 6 NOT just a toy NOT a new object system sunnavy@bestpractical.com Mooooooooooooooooose
  8. 8. Outline Introduction Seeing is believing What’s Moose? Mouse The End Google knows something about Moose sunnavy@bestpractical.com Mooooooooooooooooose
  9. 9. Outline Introduction Seeing is believing What’s Moose? Mouse The End Interested in that animal? Let’s talk about that animal later sunnavy@bestpractical.com Mooooooooooooooooose
  10. 10. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose here really is an extension of the existing object system of Perl 5 sunnavy@bestpractical.com Mooooooooooooooooose
  11. 11. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose here really is an extension of the existing object system of Perl 5 very much inspired by Perl 6 sunnavy@bestpractical.com Mooooooooooooooooose
  12. 12. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose here really is an extension of the existing object system of Perl 5 very much inspired by Perl 6 built on top of Class::MOP( Welcome to Meta world! ) sunnavy@bestpractical.com Mooooooooooooooooose
  13. 13. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose here really is an extension of the existing object system of Perl 5 very much inspired by Perl 6 built on top of Class::MOP( Welcome to Meta world! ) postmodern( just like Perl ;) sunnavy@bestpractical.com Mooooooooooooooooose
  14. 14. Outline Introduction Seeing is believing What’s Moose? Mouse The End What Moose here really is an extension of the existing object system of Perl 5 very much inspired by Perl 6 built on top of Class::MOP( Welcome to Meta world! ) postmodern( just like Perl ;) ready to use sunnavy@bestpractical.com Mooooooooooooooooose
  15. 15. Outline Introduction Seeing is believing What’s Moose? Mouse The End Official Definition Moose is a postmodern object system for Perl 5 that takes the tedium out of writing object-oriented Perl. It borrows all the best features from Perl 6, CLOS (LISP), Smalltalk, Java, BETA, OCaml, Ruby and more, while still keeping true to its Perl 5 roots. sunnavy@bestpractical.com Mooooooooooooooooose
  16. 16. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods The Request sunnavy@bestpractical.com Mooooooooooooooooose
  17. 17. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods What we normally OOP sunnavy@bestpractical.com Mooooooooooooooooose
  18. 18. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods If we have Moose . . . sunnavy@bestpractical.com Mooooooooooooooooose
  19. 19. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods You may point out. . . You skipped use strict; and use warnings; on purpose to reduce lines! sunnavy@bestpractical.com Mooooooooooooooooose
  20. 20. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods So, I’m telling you. . . Well, I skipped those two lines because Moose does that for me. sunnavy@bestpractical.com Mooooooooooooooooose
  21. 21. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods Thanks, Moose! sunnavy@bestpractical.com Mooooooooooooooooose
  22. 22. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods use ’has’ to install attributes has $name|@$names => %options sunnavy@bestpractical.com Mooooooooooooooooose
  23. 23. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) sunnavy@bestpractical.com Mooooooooooooooooose
  24. 24. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) isa ( type constraints ) sunnavy@bestpractical.com Mooooooooooooooooose
  25. 25. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) isa ( type constraints ) does ( $role ) sunnavy@bestpractical.com Mooooooooooooooooose
  26. 26. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) isa ( type constraints ) does ( $role ) required ( 1|0 ) sunnavy@bestpractical.com Mooooooooooooooooose
  27. 27. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) isa ( type constraints ) does ( $role ) required ( 1|0 ) default sunnavy@bestpractical.com Mooooooooooooooooose
  28. 28. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) isa ( type constraints ) does ( $role ) required ( 1|0 ) default predicate ( method name to check for initialization ) sunnavy@bestpractical.com Mooooooooooooooooose
  29. 29. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods %options is ( ’ro|rw’ ) isa ( type constraints ) does ( $role ) required ( 1|0 ) default predicate ( method name to check for initialization ) clearer ( method name to uninitialize ) sunnavy@bestpractical.com Mooooooooooooooooose
  30. 30. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods is ro sunnavy@bestpractical.com Mooooooooooooooooose
  31. 31. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods is ro rw sunnavy@bestpractical.com Mooooooooooooooooose
  32. 32. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods is sunnavy@bestpractical.com Mooooooooooooooooose
  33. 33. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods isa - type sunnavy@bestpractical.com Mooooooooooooooooose
  34. 34. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods isa - type sunnavy@bestpractical.com Mooooooooooooooooose
  35. 35. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods does - Role Let’s talk about Roles later sunnavy@bestpractical.com Mooooooooooooooooose
  36. 36. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods required sunnavy@bestpractical.com Mooooooooooooooooose
  37. 37. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods default sunnavy@bestpractical.com Mooooooooooooooooose
  38. 38. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods predicate and clearer sunnavy@bestpractical.com Mooooooooooooooooose
  39. 39. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods Code Reuse From S12: Classes are primarily in charge of object management, and only secondarily in charge of software reuse. In Perl 6, roles take over the job of managing software reuse. sunnavy@bestpractical.com Mooooooooooooooooose
  40. 40. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods What’s a Role? From S12: Depending on how you care to look at it, a role is like a partial class, or an interface with default implementation, or a set of generic methods and their associated data, or a class closed at compile time. sunnavy@bestpractical.com Mooooooooooooooooose
  41. 41. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods use ’with’ to apply Roles sunnavy@bestpractical.com Mooooooooooooooooose
  42. 42. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods before sunnavy@bestpractical.com Mooooooooooooooooose
  43. 43. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods before after sunnavy@bestpractical.com Mooooooooooooooooose
  44. 44. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods before after around sunnavy@bestpractical.com Mooooooooooooooooose
  45. 45. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods sunnavy@bestpractical.com Mooooooooooooooooose
  46. 46. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods sunnavy@bestpractical.com Mooooooooooooooooose
  47. 47. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods override/super sunnavy@bestpractical.com Mooooooooooooooooose
  48. 48. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods override/super augment/inner sunnavy@bestpractical.com Mooooooooooooooooose
  49. 49. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods override/super augment/inner ... sunnavy@bestpractical.com Mooooooooooooooooose
  50. 50. Outline Let’s Compare! Introduction Attributes - has Seeing is believing Roles - with Mouse Method Modifiers The End Other Methods an easy way to speed up Moose sunnavy@bestpractical.com Mooooooooooooooooose
  51. 51. Outline Introduction What’s Mouse? Seeing is believing Why? Mouse Mouse is not enough in future? The End Mouse is a lightweighted Moose. It provides a subset of Moose’s functionality. sunnavy@bestpractical.com Mooooooooooooooooose
  52. 52. Outline Introduction What’s Mouse? Seeing is believing Why? Mouse Mouse is not enough in future? The End the compile time penalty Though significant progress has been made over the years, the compile time penalty is a non-starter for some applications. sunnavy@bestpractical.com Mooooooooooooooooose
  53. 53. Outline Introduction What’s Mouse? Seeing is believing Why? Mouse Mouse is not enough in future? The End It’s easy to do s/Mouse/Moose/g; sunnavy@bestpractical.com Mooooooooooooooooose
  54. 54. Outline Introduction Seeing is believing Mouse The End Less is better sometimes less code sunnavy@bestpractical.com Mooooooooooooooooose
  55. 55. Outline Introduction Seeing is believing Mouse The End Less is better sometimes less code less tests sunnavy@bestpractical.com Mooooooooooooooooose
  56. 56. Outline Introduction Seeing is believing Mouse The End Less is better sometimes less code less tests less bugs sunnavy@bestpractical.com Mooooooooooooooooose
  57. 57. Outline Introduction Seeing is believing Mouse The End So. . . Let’s Moose from now on sunnavy@bestpractical.com Mooooooooooooooooose
  58. 58. Outline Introduction Seeing is believing Mouse The End Until. . . Perl 6 is finished sunnavy@bestpractical.com Mooooooooooooooooose
  59. 59. Outline Introduction Seeing is believing Mouse The End More Info http://www.iinteractive.com/moose sunnavy@bestpractical.com Mooooooooooooooooose
  60. 60. Outline Introduction Seeing is believing Mouse The End More Info http://www.iinteractive.com/moose #moose on irc.perl.org sunnavy@bestpractical.com Mooooooooooooooooose
  61. 61. Outline Introduction Seeing is believing Mouse The End More Info http://www.iinteractive.com/moose #moose on irc.perl.org subscribe to moose@perl.org sunnavy@bestpractical.com Mooooooooooooooooose
  62. 62. Outline Introduction Seeing is believing Mouse The End Thanks! Any Questions? sunnavy@bestpractical.com Mooooooooooooooooose
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×