App Factory

Navigation:  Development > Architecture and Standard >

App Factory

Previous pageReturn to chapter overviewNext page

App factory is a pattern that organize all appRain resource and use to perform below tasks

 

One of the major task of App factory is to load class object in an optimize way. Most of the resource has a method to create object. See bellow examples:
 

Type

Declaration

Example

Model

App::Model()

App::Model('Admin')

Helpers

App::Helper()

App::Helper('Utility')

Module

App::Module()

App::Module('ACL')

Plugin

App::Plugin()

App:Plugin('PhpMailer')

InformationSet

App::InformationSet()

App::InformationSet('EmailTemplate')

CategorySet

App::CategorySet()

App::CategorySet('blog-cat')

 
App Factory apply Singleton pattern on resource allocation to avoid object reinitialization also it manage Cache in required place. See below common function of App factory.

 

__Obj
__Def

__Transfer