Induction Framework

Induction is a request-based, model-view-controller, web application framework for Java with support for dynamic application reloading, type-based dependency injection and dependency analysis between models, views and controllers using popular IDEs. File upload handling in Induction is about as simple as handling a string input.

Induction has an extensible architecture including support for controller and redirect resolvers, plug-in configuration loaders and plug-in templating engines. Induction also features a HTML form parser that supports the use of array and dictionary form variables in HTML forms.

There are several popular web application frameworks for Java that Induction may be compared to, including: Apache Struts, , Tapestry, WebWork and JPublish

Induction was created by Acciente, LLC in response to the problems it encountered with its largest and most demanding client. Acciente, LLC felt that the investment is such a framework for private use was not justifiable, so framework was made available to the public for commercial and non-commercial use under the Apache 2.0 License

Design Goals
Induction was created to satisfy the following design goals:

* Remove the need to redeploy an application to a Servlet container every time Java code is changed. It should be possible to simply recompile the changed source (using any IDE) and simply reload the respective web page.

* The ability to analyze the dependencies between models, views and controllers to manage the evolution of large web applications

* Make it easy to use dependency injection

* Applications should not be cluttered by superfluous XML configuration files.

* Handling file uploads should be so simple to the point of being unremarkable

Overview

Induction advocates the use of the model-view-controller paradigm to web application development. Following is a brief summary of how Induction supports models, views and controllers. In Induction the most important types of classes are controllers, views, models and model factories. A very simple application may only use controllers, but most applications will use controllers, views and models and very likely one or more model factories.

Controllers

* All requests received by the Servlet container are dispatched to a controller

* A controller is a class which implements the Controller marker interface (the Controller interface just marks a class as a controller, and does not enforce any methods)

* A model object or environment object (such as the Request, Response or Form) is accessible in a controller by simply declaring a parameter of the model object’s type in the controller’s respective method (this is basically dependency injection)

* A controller may have a method for each distinct task that it performs:
** The default URL to controller mapping allows specifying the controller class and method name in the URL path, for example: http://sample_domain.org/demoapp/counter_app/CounterController/incrementCounter, where the controller class is demoapp.counter_app.CounterController and the method named to be invoked is incrementCounter
** Omitting the method implies a default(configurable) method name should be called (usually named handler)

* The type of the return value of a controller is significant, each possible type and their meaning is given below:
** Template: processes and returns the content of the specified template object to the client
** Text: returns the text contents to the client
** Image/ImageStream: returns the image contents to the client

Views

* A view class is a that implements one of the following interfaces (based on the purpose of view):
** Template
** Image
** ImageStreamer
** Text

* A class, say C1, that implements the Template interface is processed via one of the integrated template engines.
** When processing the template the only data passed to the template is an instance of the class C1. C1 serves as the bean that documents precisely what data the associated template needs.

Models

* Implements pure application logic, completely independent of views and controllers. In other words models are completely independent of the Induction framework.

* Any class can be a model

* A configurable factory class may be provided for each model class

* Declarative control of the life-cycle of each model class:
** Application: a model object is created for the life of the application
** Session: a model object is created for each browser session
** Request: a model object is created for each controller invocation
 
< Prev   Next >