start of the TC refactor
[gitmo/Moose.git] / PLANS
1 -----------------------------------------------------------
2 -- Type Constraints refactor
3 -----------------------------------------------------------
4
5 - move the details of TC construction that are in Moose.pm and 
6   Moose::Util::TypeConstraints into the Moose::Meta::TypeConstraint module
7
8 This will make it much easier to generate TCs on their own, without 
9 having to use the sugar layer. This should also clean up their APIs 
10 as well, which will make it easier to subclass them.
11
12 - create an official TC registry API
13
14 Right now the registration of the TC is a by-product of creation in the sugar 
15 layer, this is bad and make extension of TCs difficult. I am not sure if this 
16 registry API should exist as part of Moose::Util::TypeConstraints, or of we 
17 should create a complete registry object itself. 
18
19 This registry should be a singleton, but M::U::TC should enforce that lifecycle 
20 choice so that you can use your own registry if you really want too.
21
22 I mean parent of the registry. So that I can create my own registry
23 object for a given class, and any retrieval of a type constraint from
24 this object would automatically search parent registries as well.
25
26 - refactor the various TC internals to make it more subclassing friendly
27
28 This also includes the coercion stuff as well. This should give you what you 
29 need to make your object/class bound stuff.
30
31 - move the container TCs from MooseX::AttributeHelpers into Moose core
32
33 These have proven so useful for me in the latest $work project that I think 
34 they should really be core. 
35
36 - allow a switch of some kind to optionally turn TC checking off at runtime 
37
38 The type checks can get expensive and some people have suggested that allowing 
39 the checks to be turned off would be helpful for deploying into performance 
40 intensive systems. Perhaps this can actually be done as an option to make_immutable? 
41
42 - misc. minor bits
43
44 * make the errors for TCs use ->message
45 * look into localizing the messages too
46 * make ANON TCs be lazy, so they can possibly be subsituted for the real thing later
47 * make ANON TCs more introspectable
48
49
50 -----------------------------------------------------------
51 -- Roles refactor
52 -----------------------------------------------------------
53
54
55 -----------------------------------------------------------
56 -- Immutable refactor
57 -----------------------------------------------------------