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