Finished slides & exercises for section 4 (method modifiers)
[gitmo/moose-presentations.git] / moose-class / slides / outline
CommitLineData
b751d33f 1= Intro (30 minutes)
2
3* concepts (ala Moose::Manual::Concepts)
4
5= Classes
6
7* Making a class use Moose
8* extends
9* overrides/super
10* trivial attributes
11** has 'foo' => ( is => ... ) (ro & rw)
12** no other attribute features yet
13* "no Moose"
14* Immutability
15
16== Exercises
17
18* Build a Person class that uses Moose
19** first_name
20** last_name
21** assume both attributes are always provided
22* build an Employee class that is a subclass of Person
23** job_title
24
25= Roles
26
27* Making a role
28* roles as interfaces
29* requires
30* consuming roles in classes
31* consuming roles in roles
32* "no Moose::Role"
33
34== Exercises
35
36* build a role for Human
37* make the Person class consume the role
38* make the role require a "full_name" method
39* implement this method for Person
40* override it for Employee to include their title
41
42= Basic attributes
43
44* required
45* default & builder
46* lazy
8d1ce1d7 47* predicate, clearer
b751d33f 48* init_arg
8d1ce1d7 49* reader & writer
50* attribute inheritance
51* MX attribute naming modules
b751d33f 52
53== Exercises
54
55* Go back to Person class
56** make first & last name required
57* Go back to Employee
58** make title default to "Worker"
8d1ce1d7 59** add predicate & clearer for title
b751d33f 60** add salary_level attribute, number from 1-10
61** salary, lazy default of salary_level * 1,000, init_arg is undef
62
63= Method modifiers
64
65* before/after
66** before for state validation
67** after for additional state changes
68* around
69** modifying arguments & return values
26164c8d 70* method modifiers in roles
71** requiring the wrapped method
72* augment/inner
b751d33f 73
74== Exercises
75
b751d33f 76= Types
77
78* built-in types
79* parameterizable types
80* declaring subtypes
81** URI
82** Email
83** class names & role names
84* coercions
85* attribute isa & does
86
87== Exercises
88
8d1ce1d7 89= Advanced attributes
90
91* weak_ref
92* triggers
93* delegation
94* metaclass & traits
95
96== Exercises
97
b751d33f 98= Introspection
99
100== Exercises
101
26164c8d 102= Tour of MooseX
103
104= Writing a MooseX Module
b751d33f 105
106== Exercises