Search
Categories
Documents
App - Backplane for core App services (Displayed)
|
App - Backplane for core App services
App - Backplane for core App services
use App;
my ($context, $conf, $object);
$context = App->context(); # singleton per process
$conf = App->conf(); # returns a hashref to conf
$context = App->new();
$object = App->new($class);
$object = App->new($class, $method);
$object = App->new($class, $method, @args);
The App module is the module from which core services are
called.
The App-Context distribution is the core set of modules implementing
the core of an enterprise application development framework.
http://www.officevision.com/pub/App-Context
* Version: 0.01
It provides the following services.
* Application Configuration (App::Conf::*)
* Session Management (App::Session::*)
* Remote Procedure Call (App::Procedure::*)
* Session Objects and Remote Method Invocation (App::SessionObject::*)
* Multiprocess-safe Name-Value Storage (App::SharedDatastore::*)
* Shared Resource Pooling and Locking (App::SharedResourceSet::*)
One of App-Context's extended services (App::Repository::*)
adds distributed transaction capabilities and access to data
from a variety of sources through a uniform interface.
In the same distribution (App-Repository), is a base class,
App::RepositoryObject, which serves as the base class for
implementing persistent business objects.
http://www.officevision.com/pub/App-Repository
Another of App-Context's extended services (App::Widget::*)
adds simple and complex active user interface widgets.
These widgets can be used to supplement an existing application's
user interface technology (template systems, hard-coded HTML, etc.)
or the Widget system can be used as the central user interface paradigm.
http://www.officevision.com/pub/App-Widget
App-Context and its extended service distributions were
inspired by work on the Perl 5 Enterprise Environment project,
and its goal is to satisfy the all of the requirements embodied in
the Attributes of an Enterprise System.
See the following web pages for more information about the P5EE project.
http://p5ee.perl.org/
http://www.officevision.com/pub/p5ee/
The following are enumerated requirements for the App-Context distribution.
It forms a high-level feature list.
The requirements which have been satisfied
(or features implemented) have an ``x'' by them, whereas the requirements
which have yet-to-be satisfied have an ``o'' by them.
o an Enterprise Software Architecture, supporting all the Attributes
http://www.officevision.com/pub/p5ee/definitions.html
o a Software Architecture supporting many Platforms
http://www.officevision.com/pub/p5ee/platform.html
o a pluggable interface/implementation service architecture
o support developers who wish to use portions of the App-Context
framework without giving up their other styles of programming
(and support gradual migration)
The distribution is designed in such a way that most of the functionality
is actually provided by modules outside the App namespace.
The goal of the App-Context framework
is to bring together many technologies to make a
unified whole. In essence, it is collecting and unifying the good work
of a multitude of excellent projects which have already been developed.
This results in a Pluggable Service design which allows just about
everything in App-Context to be customized. These Class Groups are described
in detail below.
Where a variety of excellent, overlapping or redundant, low-level modules
exist on CPAN (i.e. date and time modules),
a document is
written to explain the pros and cons of each.
Where uniquely excellent modules exist on CPAN, they are named outright
as the standard for the App-Context framework.
They are identified as dependencies
in the App-Context CPAN Bundle file.
The major Class Groups in the App-Context distribution fall into three categories:
Core, Core Services, and Services.
The Core Class Group contains the following classes.
App is the main class through which all of the features
of the Perl 5 Enterprise Environment may be accessed.
* Throws: Exception::Class::Base
* Throws: App::Exception
* Throws: App::Exception::Conf
* Throws: App::Exception::Context
* Since: 0.01
The class is entirely made up of static (class) methods.
There are no constructors for objects of this class itself.
Rather, all of the constructors in this package are really
factory-style constructors that return objects of different
classes.
In particular, the new() method is really a synonym for context(),
which returns a Context object.
This class supports the following capabilities.
- Capability: Service Factory
This package allows you to construct objects (services) that
you do not know
the classes for at development time. These classes are specified
through the configuration and are produced using this package as
a class factory.
* Global Variable: $App::DEBUG integer
* Signature: App->use($class);
* Param: $class string [in]
* Return: void
* Throws: <none>
* Since: 0.01
Sample Usage:
App->use("App::Widget::Entity");
The use() method loads additional perl code and enables aspect-oriented
programming (AOP) features if they are appropriate. If these did not
need to be turned on or off, it would be easier to simply use the
following.
eval "use $class;"
The first AOP
feature planned is the printing of arguments on entry to a method and
the printing of arguments and return values on exit of a a method.
This is useful
for debugging and the generation of object-message traces to validate
or document the flow of messages through the system.
Detailed Conditions:
* use(001) class does not exist: throw a App::Exception
* use(002) class never used before: should succeed
* use(003) class used before: should succeed
* use(004) can use class after: should succeed
* Signature: App->printargs($depth, $skipatend, @args);
* Param: $depth integer [in]
* Param: $skipatend integer [in]
* Param: @args any [in]
* Return: void
* Throws: none
* Since: 0.01
The App->new() method is not a constructor for
a App class. However, it is a constructor, returning
an object of the class given as the first parameter.
If no parameters are given,
it is simply a synonym for ``App->context()''.
* Signature: $context = App->new()
* Signature: $object = App->new($class)
* Signature: $object = App->new($class,$method)
* Signature: $object = App->new($class,$method,@args)
* Param: $class class [in]
* Param: $method string [in]
* Return: $context App::Context
* Return: $object ref
* Throws: Exception::Class::Base
* Since: 0.01
Sample Usage:
$context = App->new();
$dbh = App->new("DBI", "new", "dbi:mysql:db", "dbuser", "dbpasswd2");
$cgi = App->new("CGI", "new");
* Signature: $context = App->context()
* Param: contextClass class [in]
* Param: confFile string [in]
* Return: $context App::Context
* Throws: App::Exception::Context
* Since: 0.01
Sample Usage:
$context = App->context();
$context = App->context(
contextClass => "App::Context::HTTP",
confFile => "app.xml",
);
This static (class) method returns the $context object
of the context in which you are running.
It tries to use some intelligence in determining which
context is the right one to instantiate, although you
can override it explicitly.
It implements a ``Factory'' design pattern. Instead of using the
constructor of a class itself to get an instance of that
class, the context() method of App is used. The former
technique would require us to know at development time
which class was to be instantiated. Using the factory
style constructor, the developer need not ever know what physical class
is implementing the ``Context'' interface. Rather, it is
configured at deployment-time, and the proper physical class
is instantiated at run-time.
* Signature: $conf = App->conf(%named);
* Param: confClass class [in]
* Param: confFile string [in]
* Return: $conf App::Conf
* Throws: App::Exception::Conf
* Since: 0.01
* Signature: $ident = App->info();
* Param: void
* Return: $ident string
* Throws: App::Exception
* Since: 0.01
* Author: Stephen Adkins <stephen.adkins@officevision.com>
* License: This is free software. It is licensed under the same terms as Perl itself.
Information
|
This site is currently in testing, it is not yet operating using the full database. Until it is officially launched you may wish to visit Help-Site Computer Manuals. After launch, this site (HelpSpy) will replace Help-Site. Information about the spider which is currently trawling the Internet looking for links to add to this directory can be found here. |
|