Changes between Version 3 and Version 4 of Concepts/CoreLibs
- Timestamp:
- 04/01/06 19:28:19 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Concepts/CoreLibs
v1 v4 1 = The Core Libraries ofSeagull =1 = Library Organisation in Seagull = 2 2 3 3 [[TOC]] 6 6 7 7 The library classes used in the Seagull framework basically fall into the following groups: 8 * Workflow 9 * Utility 10 * Task 11 * PEAR 8 * Controllers - workflow 9 * Core - general 10 * Tasks - mostly used to do setup tasks 11 * Filters - modify the request and response objects as they pass through the filter chain 12 * PEAR libs - general 12 13 13 Developing with Seagull involves building modules that include 1 or more manager classes to implement business logic. Building managers is eased by using the above-listed library resources. For a typical project you will probably only ever use the Workflow, Utilityand PEAR libs.14 Developing with Seagull involves building modules that include one or more manager classes to implement business logic. Building managers is eased by using the module creator wizard and above-listed library resources. For a typical project you will probably only ever use the Controllers, Core and PEAR libs. 14 15 15 The following sections explain the library groupings and describe the basically functionality of each class. 16 The following sections explain the library groupings and describe the basically functionality of each class. This will be of more interest to advanced devs, beginners need not worry as default task and filters are all you'll need for basic web apps. 16 17 17 18 === Workflow Classes === 19 The workflow classes are Controllers and template helpers, you won't need to modify these. 20 18 === Controller Classes === 19 The controller classes manage application workflow, several examples are provided but it's very easy to write your own. 21 20 22 21 || '''Class name''' || '''Availability''' || '''Methods''' || '''Description''' || 23 || SGL_ AppController || default || * run || The !AppController is used to organise workflow for particular application types. You will probably use similar controllers for each application you build, although workflow can be easily customised. See the [http://trac.seagullproject.org/file/trunk/etc/sglBridge.php unit test controller] versus the [http://trac.seagullproject.org/file/trunk/lib/SGL/AppController.php Seagull] one for ideas on how to customise.[[BR]] ||24 || SGL_ Output || default || || The SGL_Ouput class is known as a TemplateHelper in other contexts, it wraps methods used by the template engine to transform the data into, eg, html.[[BR]] ||22 || SGL_FrontController || default || * run || The !FrontController is used to organise workflow for particular application types. You will probably use similar controllers for each application you build, although workflow can be easily customised. See the [http://trac.seagullproject.org/file/trunk/etc/sglBridge.php unit test controller] versus the [http://trac.seagullproject.org/file/trunk/lib/SGL/FrontController.php Seagull] one for ideas on how to customise.[[BR]] || 23 || SGL_Manager || default || * validate[[BR]] * process[[BR]] * display[[BR]] * maintainState || The Manager class is an app controller, it sets out generic validate/process/display workflow.[[BR]] || 25 24 || SGL_Wizard || default || * validate[[BR]] * process[[BR]] * display[[BR]] * maintainState || The Wizard class is a specialisation of the Manager class, use it to create wizard workflows in your applications.[[BR]] || 26 25 27 26 28 === Utility Classes === 29 Utility classes are what you use in your managers to manipulate system, application and user resources. Availability refers to whether you need to include the class or not, anything labelled as 'default' is available within the application scope, like default classes in, eg, java.lang. 'Requirable' libs need to be included. 30 27 === Core Classes === 28 The core classes are what you use in your managers to manipulate system, application and user resources. Availability refers to whether you need to include the class or not, anything labelled as 'default' is available within the application scope, like default classes in, eg, java.lang. 'Requirable' libs need to be included. 31 29 32 30 || '''Class name''' || '''Availability''' || '''Methods''' || '''Description''' || 33 31 || SGL || default || ||Provides a set of static utility methods used by most modules || 34 32 || SGL_Request || default || ||Wraps all $_GET $_POST $_FILES arrays into a Request object, provides a number of filtering methods || 33 || SGL_Output || default || || The SGL_Ouput class is known as a !TemplateHelper in other contexts, it wraps methods used by the template engine to transform the data into, eg, html.[[BR]] || 35 34 || SGL_Config || default || ||Config file parsing and handling, acts as a registry for config data || 36 || SGL_Registry || default || ||Generic data storage object, referred to as $input. Holds references to Url, currentRequest and Config singletons ||35 || SGL_Registry || default || ||Generic data storage object, referred to as $input. Holds references to Url, Request and Config singletons || 37 36 || SGL_DB || default || ||Mostly used as a DB resource singleton, also provides dsn building method || 38 || SGL_Url || default || ||Provides url related functionality, derived from Net_URL and uses a parser strategy || 37 || SGL_ServiceLocator || default || ||Facilitates switching resources at runtime, eg, so a test database resource can be swapped in for the dev one || 38 || SGL_Url || default || ||Provides URI related functionality, derived from Net_URL and uses a parser strategy || 39 39 || SGL_HTTP || default || ||Provides HTTP functionality including redirects || 40 || SGL_ HTTP_Session || default || ||Handles session management, most methods are static ||40 || SGL_Session || default || ||Handles session management, most methods are static || 41 41 || SGL_String || default || ||Various string helper methods || 42 || SGL_Array || default || ||Provides array manipulation methods || 42 43 || SGL_Date || default || ||Provides various date formatting methods || 43 || SGL_Array || default || ||Provides array manipulation methods || 44 || SGL_Inflector || default || ||Performs transformations on resource names, ie, urls, classes, methods, variables || 44 || SGL_Inflector || default || ||Performs transformations on resource names, ie, URIs, classes, methods, variables || 45 45 || SGL_Delegator || default || ||PHP 4/5 compatible class for aggregating objects || 46 46 || SGL_Util || default || ||Various utility methods || 55 55 56 56 57 === Tasks ===58 All tasks are optional, configurable, and can be ordered according to need.57 === Filters === 58 All filters are optional, configurable, and can be ordered according to need. 59 59 60 The process tasks below implement the Intercepting Filterpattern, each filter must extend SGL_DecorateProcess and acts as a filter pass on the Request object.60 The process tasks below implement the [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/DesInterceptingFilter.asp Intercepting] [http://java.sun.com/blueprints/corej2eepatterns/Patterns/InterceptingFilter.html Filter] pattern, each filter must extend SGL_DecorateProcess and acts as a filter pass on the Request object. 61 61 62 62 83 83 The install tasks below are simple units of work that can optionally take an argument, ie $data. Each must extend SGL_Task or a specialisation of it. 84 84 85 === Tasks === 85 86 86 87 || '''Class name''' || '''Availability''' || '''Group''' || '''Description''' ||
