Commit | Line | Data |
df2804f5 |
1 | =head1 NAME |
2 | |
3 | Reaction::Manual::Intro - Introduction to Reaction |
4 | |
cc4f29bf |
5 | =head1 SYNOPSIS |
df2804f5 |
6 | |
cc4f29bf |
7 | Moose + Catalyst + Layered Models = eternal happiness |
df2804f5 |
8 | |
cc4f29bf |
9 | =head1 MOTIVATION |
df2804f5 |
10 | |
cc4f29bf |
11 | While L<Catalyst> is a very powerful and flexible web app |
12 | framework, many pieces end up being recoded for each |
13 | new application: user interfaces, in particular. |
df2804f5 |
14 | |
cc4f29bf |
15 | Meanwhile, advances in Perl metaprogramming (especially L<Moose>) |
16 | have opened up new possibilities in terms of introspection. |
17 | Why not build user interfaces based on class metadata? |
18 | This would allow the user interface templates to be very general |
19 | where possible. |
df2804f5 |
20 | |
cc4f29bf |
21 | Thus, Reaction is basically an extended MVC framework, which |
22 | leverages class metadata to reduce or eliminate UI coding. |
df2804f5 |
23 | |
cc4f29bf |
24 | But it's much more.... |
df2804f5 |
25 | |
cc4f29bf |
26 | =head1 DOMAIN MODELS AND INTERFACE MODELS |
df2804f5 |
27 | |
cc4f29bf |
28 | Many programmers are now comfortable using ORMs of one sort or |
29 | another - L<DBIx::Class>, L<Class::DBI>, Hibernate, etc. These systems |
30 | are wonderful for bridging from the world of OO into the world of relational |
31 | databases (or other datastores). This model is sometimes called a |
32 | "domain model", because it models the "nouns" of a problem domain in |
33 | the real world. Domain models are easily shared accross applications, |
34 | and can enforce validation and other integrity constraints. |
df2804f5 |
35 | |
cc4f29bf |
36 | However, over time, many application developers find themselves adding |
37 | business logic to the domain model. This business logic is often |
38 | application-specific, and reduces the reusability of the domain model. |
39 | Worse, business logic becomes spread between the model and the contoller. |
df2804f5 |
40 | |
cc4f29bf |
41 | Reaction adds another layer, the Interface Model. Interface models provide an |
42 | adaptor to the domain model, customized for a particular application (or group |
43 | of use cases). This decouples the domain model from the application, |
44 | allowing it to be reused more freely. Additionally, the Interface Model |
45 | becomes the natural location for business logic. |
df2804f5 |
46 | |
cc4f29bf |
47 | Happily, Reaction again uses reflection to make the degenerate case easy - when your |
48 | IM has no customized functionality, it can simply delegate all work to the DM. When |
49 | you need to add custom business logic, you can add or replace functionality as needed. |
df2804f5 |
50 | |
63bb30b4 |
51 | The DM/IM split is sometimes referred to as a FacadeModel - see |
52 | L<http://www.twinforces.com/tf/docs/MFCV.html>, for example. |
df2804f5 |
53 | |
cc4f29bf |
54 | =head1 WHAT YOU'LL NEED TO KNOW |
df2804f5 |
55 | |
cc4f29bf |
56 | Reaction is based on the L<Catalyst> web application framework. You'll certainly |
57 | need to be familiar with L<Catalyst::Manual::Intro>. |
df2804f5 |
58 | |
cc4f29bf |
59 | Currently, only L<DBIx::Class> is supported as a domain model. At least basic |
60 | familiarity will be needed. L<DBIx::Class::Manual::Intro> is a good starting point. |
888532d3 |
61 | |
cc4f29bf |
62 | The default view renderer is L<Template::Toolkit>. To edit your views, you'll |
63 | need to know something about it. |
888532d3 |
64 | |
cc4f29bf |
65 | While you don't need to know L<Moose> directly, a lot of the concepts of |
66 | metaprogramming will keep coming up as you work with Reaction. |
67 | Thus, getting to know L<Moose> will serve you well. |
888532d3 |
68 | |
cc4f29bf |
69 | =head1 NEXT STEPS |
888532d3 |
70 | |
63bb30b4 |
71 | The L<Reaction::Manual::Overview> document tries to tie the parts of reaction |
72 | together to form a big picture. |
73 | |
cc4f29bf |
74 | If you'd like an example, see L<Reaction::Manual::Example>. |
888532d3 |
75 | |
63bb30b4 |
76 | If you're ready to dive in and start learning step by step, see |
77 | L<Reaction::Manual::Tutorial>. |
888532d3 |
78 | |
63bb30b4 |
79 | As you encounter unfamiliar terms, or want to see how a particular term is used in the |
80 | context of the Reaction project, refer to the L<Reaction::Manual::Glossary>. |
df2804f5 |
81 | |
82 | =head1 SEE ALSO |
83 | |
84 | =over |
85 | |
86 | =item * L<Reaction::Manual::Cookbook> |
87 | |
88 | =item * L<Reaction::Manual::FAQ> |
89 | |
90 | =back |
91 | |
92 | =head1 AUTHORS |
93 | |
94 | See L<Reaction::Class> for authors. |
95 | |
96 | =head1 LICENSE |
97 | |
98 | See L<Reaction::Class> for the license. |
99 | |
100 | =cut |