first cut of Reaction::UI::Skin and SiteLayout VP+widget
[catagits/Reaction.git] / lib / Reaction / Manual / Intro.pod
index 73d3846..523e5e8 100644 (file)
@@ -10,11 +10,12 @@ Reaction is basically an extended MVC:
 
 =item Domain Model 
 
-DBIC schema, etc.
+DBIx::Class::Schema, MyApp::Foo, MyApp::Bar, etc.
 
 =item Interface Model 
 
-Model::DBIC::Schema and Action classes.
+InterfaceModel::DBIC::Schema, InterfaceModel::Action,
+MyApp::InterfaceModel::Foo classes.
 
 =item Controller 
 
@@ -22,11 +23,15 @@ Mediation and navigation.
 
 =item ViewPort
 
-View logic and event handling encapsulation.
+Event handling encapsulation.
+
+=item Widget
+
+View logic.
 
 =item Renderer 
 
-View:: classes, handed viewports.
+MyApp::View:: classes, renders viewports.
 
 =back
 
@@ -37,9 +42,69 @@ itself from your interface model, which is a model of how a particular app or
 class of apps interact with that domain and provides objects/methods to
 encapsulate the common operations it does.
 
-=head2 Basic usage
+=head2 Domain Models vs Interface Models
+
+Domain models are expected to drive the application business logic and data.
+All domain models that need to be effectively displayed somehow at the user
+interface (a table, for instance) must interact with an interface model.
+These should provide the common methods needed in order to carry out
+user-generated events.
+
+=head1 SETTING UP A REACTION APPLICATION
+
+Reaction applications are set up just like Catalyst:
+
+    $ catalyst.pl MyApp
+    # output ommited
+    $ cd MyApp
+
+=head2 Models
+
+Reaction provides a reflector component which automagically
+maps a L<DBIx::Class::Schema> into a set of Interface Models which can be used
+by Reaction to build the interface components. If you're not familiar with
+L<DBIx::Class> or don't have a schema handy, now is a good time to go through
+L<DBIx::Class::Manual::Intro> to get a schema set up.
+
+    package MyApp::InterfaceModel::DBIC;
+
+    use base 'Reaction::InterfaceModel::Object';
+    use Reaction::InterfaceModel::Reflector::DBIC;
+
+    my $reflector = Reaction::InterfaceModel::Reflector::DBIC->new;
+
+    $reflector->reflect_schema(
+         model_class  => __PACKAGE__,
+         schema_class => 'MyApp::Schema',
+         sources => [qw/Foo Baz/],
+    );
+
+    1;
+
+=head2 Controllers
+
+Your Reaction application must have a Root controller which inherits from
+C<Reaction::UI::Controller::Root>.
+
+    package MyApp::Controller::Root;
+
+    use warnings;
+    use strict;
+    use base qw/Reaction::UI::Controller::Root/;
+
+    __PACKAGE__->config(
+        view_name => 'Site',
+        window_title => 'My Reaction App',
+        namespace => ''
+    );
+
+    1;
+
+XX TODO
+
+=head2 View
 
-XXX TODO
+XX TODO
 
 =head1 SEE ALSO