NAME
Oak::Application - Class for creating applications in Oak
HIERARCHY
Oak::Object
Oak::Application
DESCRIPTION
This is the class that will be used to create real applications, the executable file will launch it.
When you create an application object, a reference is created as $::APPLICATION. If you want to undef the Oak::Application object by hand, you need to undef it also.
PROPERTIES
- topLevels
-
A hashref containing information about the toplevel objects: name => [class, xmlfile, persistent]
If the persistent param is defined, the object will not be deleted and recreated every itaration of the application. This is usefull for Oak::DataModule components.
- default
-
The default toplevel, the first toplevel to be shown on application startup
METHODS
- constructor
-
This method was overwrited to create all the objects passed to new. The objects it creates will be available in the namespace ::TL. ie: If one toplevel component have the name pagLogin, its object will be available as $::TL::pagLogin.
- initiateTopLevel(NAME)
-
Creates the Top-Level object NAME defined in the XMLFILE using CLASS.
The exceptions generated by Oak::Component wont be treated here, so, they will propagate to the first level.
Exceptions generated by Oak::Application Oak::Application::Error::DuplicatedTopLevel - toplevel components have the same name Oak::Application::Error::ClassNotFound - toplevel class not found in lib
- freeAllTopLevel
-
Destroy all the top level components.
- DESTROY
-
Overwrited to undef the objects created in the ::TL namespace.
- run
-
Abstract in Oak::Application, each type of application will implement how they run.
EXCEPTIONS
The following exceptions are introduced by Oak::Application
- Oak::Application::Error::ClassNotFound
-
This error is throwed when the class passed as parameter to the new failed to be required.
- Oak::Application::Error::DuplicatedTopLevel
-
This error is throwed when two toplevel components have the same name
EXAMPLES
my $app = new Oak::Application
(
"formCreate" => ["MyApp::TopLevel1", "TopLevel1.xml"],
"formList" => ["MyApp::TopLevel2", "TopLevel2.xml"],
"formSearch" => ["MyApp::TopLevel3", "TopLevel3.xml"],
"default" => "formCreate"
);
$app->run; # abstract in Oak::Application
COPYRIGHT
Copyright (c) 2001 Daniel Ruoso <daniel@ruoso.com> All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.