3 Reaction::Manual::Intro - Introduction to Reaction
7 Moose + Catalyst + Layered Models = eternal happiness
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.
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
21 Thus, Reaction is basically an extended MVC framework, which
22 leverages class metadata to reduce or eliminate UI coding.
24 But it's much more....
26 =head1 DOMAIN MODELS AND INTERFACE MODELS
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.
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.
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.
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.
51 The DM/IM split is sometimes referred to as a FacadeModel - see L<http://www.twinforces.com/tf/docs/MFCV.html>, for example.
53 =head1 WHAT YOU'LL NEED TO KNOW
55 Reaction is based on the L<Catalyst> web application framework. You'll certainly
56 need to be familiar with L<Catalyst::Manual::Intro>.
58 Currently, only L<DBIx::Class> is supported as a domain model. At least basic
59 familiarity will be needed. L<DBIx::Class::Manual::Intro> is a good starting point.
61 The default view renderer is L<Template::Toolkit>. To edit your views, you'll
62 need to know something about it.
64 While you don't need to know L<Moose> directly, a lot of the concepts of
65 metaprogramming will keep coming up as you work with Reaction.
66 Thus, getting to know L<Moose> will serve you well.
70 If you'd like an example, see L<Reaction::Manual::Example>.
72 If you're ready to dive in and start learning step by step, see L<Reaction::Manual::Tutorial>.
74 As you encounter unfamiliar terms, or want to see how a particular term is used in the context of the Reaction project, refer to the L<Reaction::Manual::Glossary>.
80 =item * L<Reaction::Manual::Cookbook>
82 =item * L<Reaction::Manual::FAQ>
88 See L<Reaction::Class> for authors.
92 See L<Reaction::Class> for the license.