First draft of method modifiers manual
[gitmo/Moose.git] / lib / Moose / Manual / BestPractices.pod
1
2 =head1 RECOMMENDATIONS
3
4 =head2 No Moose and Immutabilize
5
6 We recommend that you end your Moose class definitions by removing the
7 Moose sugar and making your class immutable.
8
9   package Person;
10
11   use Moose;
12
13   # extends, roles, attributes, etc.
14
15   # methods
16
17   no Moose;
18
19   __PACKAGE__->meta->make_immutable;
20
21   1;
22
23 =head2 Always call SUPER::BUILDARGS
24
25 =head2 No complex subs for a default, use a builder
26
27 builders can be inherited, show up more cleanly in profile
28
29 =head2 use default for simple scalar, and empty refs
30
31 =head2 use builder for everything else
32
33 =head2 use lazy_build
34
35 keep builders private
36
37 consider keeping clearers & predicates private
38
39 consider keeping writers private