Fix so that superclasses and roles get applied from config. This is where the method...
[catagits/CatalystX-DynamicComponent.git] / TODO
CommitLineData
ff05b07e 1TODO, or the plan for making this stuff work right.
2
3The goals:
4
51/ I want to be able to specify a Controller base class, like
6 Catalyst::Controller::MessageDriven. That's where my
7 message-handling actually lives, so I want to build controllers
8 based on that, or whichever other class.
9
102/ We need a calling convention for the model implementations - in the
11 absence of defined interfaces this should be simple unblessed data,
12 but if we do have an interface, we should be able to put proper
13 constraints on it.
14
153/ Given generated controllers where I expose a bunch of methods from
16 the actual model classes, there needs to be some way to control
17 which methods are dispatchable - "very public", if you like.
18
194/ I'd like to be able to write down an "interface", consisting of a
20 set of messages my app is willing to handle, and have the framework
21 (or the controller base class, probably) reject messages that
22 aren't in that set.
23
245/ I'd also like to be able to say in that interface definition what
25 types of object those methods expect as a payload.
26
276/ It'd be nice if exceptions from model methods were caught by the
28 framework and converted into messages representing the error -
29 i.e. to set an error status, and return the text of the exception.
30
31All these things should be based on configuration. So, we've got
32something to say what classes expose methods, which of those methods
33are dispatchable, and which types are expected.
34
35Possible Implementation
36
37We can provide a number of controller base classes, for a number of
38different message styles: YAML with type-tags, JSON bare hashes,
39etc. These should be selectable by configuration, as a default
40controller class plus overrides for specific controllers.
41
42The calling convention to model methods should be the "payload". That
43might be a bare hashref for simple messages, or a blessed object of
44some app-specific type if the message format contains first-class
45objects, like tagged YAML.
46
47The "interfaces" should be Roles, which don't provide any methods but
48which "need" methods to be implemented. We then use the "needed"
49methods as the set of dispatchable methods, given if we compile OK, we
50know that the model class has all the required methods.
51
52Types are implemented as type signatures on role methods, and we copy
53them onto the actual methods on the model class at compile time.
54
55Exception handling probably needs to be behaviour from the controller
56base class, so that it can be specific to the type of message
57serialization being used.