Commit | Line | Data |
fd8a7262 |
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 | |
b6477964 |
33 | don't use initializer |
34 | |
fd8a7262 |
35 | =head2 use lazy_build |
36 | |
37 | keep builders private |
38 | |
39 | consider keeping clearers & predicates private |
40 | |
41 | consider keeping writers private |
b6477964 |
42 | |
43 | =head2 use MX::AH instead of auto_deref |