<span id="Label3"></p><p><p></p></p><p><p>The table in this topic details the steps performed when an XAF asp. NET application is Running.</p></p><span class="dx-notes-title dx-note-title"><span class="dx-notes-title dx-note-title"><span class="dx-notes-title dx-note-title">Note</span></span></span><p><p>currently, only the steps-performed until the main page is shown is Detailed.</p></p> <table class="dtTABLE" cellspacing="0"> <tbody> <tr> <th>Stage</th> <th>Description</th> <th>Ways to interfere</th> </tr> <tr valign="top"> <td>Application is requested</td> <td>See Asp. application Creation and Initialization.</td> <td></td> </tr> <tr valign="top"> <td>An end-user is authenticated</td> <td>See User authentication using a logon window in asp. applications and User authentication without a logon window in ASP . NET Applications.</td> <td></td> </tr> <tr valign="top"> <td>Start-up pop-up Window Show Actions are Executed.</td> <td>A Collection of pop-up Window Show Actions is populated by the the actions, is registered as start-up actions in modules Used by the Application. For instance, the Changepasswordonlogon represents a start-up Action. A pop-up window is displayed for each of the action after an end-user have executed or canceled the previous Action.</td> <td>To register an Action as a start-up, override the <strong>getstartupactions</strong> method in your module class. Return a list of pop-up Window Show Actions in this method (see popupwindowshowaction).</td> </tr> <tr valign="top"> <td>Start-up window is shown</td> <td>See Show the Main Page in asp. applications.</td> <td></td> </tr> </tbody> </table><p><p></p></p>ASP. Application Creation and initialization<p><p></p></p><p><p>This topic details the steps performed after an end-user have requested an XAF asp. application until the moment the MA In XAF objects, like the webapplication, is created and Initialized.</p></p><p><p>In the following image, you can see that the entire process of the application initialization can is divided into five Ste Ps.</p></p><p><p></p></p><p><p></p></p><p><p>The table below describes all these steps in Detail.</p></p> <table class="dtTABLE" cellspacing="0"> <tbody> <tr> <th>Stage</th> <th>Description</th> <th>Ways to interfere</th> </tr> <tr valign="top"> <td>A WEB Application is created</td> <td>At the beginning of a request this begins a new session, an instance of the Webapplicationclass is Created. This was performed by the <strong>Global.session_start</strong> method, automatically generated in your ASP application project .</td> <td></td> </tr> <tr valign="top"> <td>Initial Application Initialization</td> <td>A newly created application is Initialized. The settings that is specified in the configuration File's <em>appSettings</em> section is read to the Application:</td> <td></td> </tr> <tr valign="top"> <td></td> <td><p>The Xafapplication.tableprefixes property was set to the value assigned to the <strong>tableprefixes</strong>key in the Configurati On File.</p></td> <td><p>If It is not a necessary for your to set table prefixes in the configuration file, you can do it in Code. To does this, set the <strong>tableprefixes</strong>property After an Application object have been created, but before its xafapplica Tion. Setup method is Called.</p></td> </tr> <tr valign="top"> <td></td> <td><p>The location to being used to store the <em>Model.User.xafml</em> file was specified by the <strong>usermodeldiffslocation</strong> ke Y.</p></td> <td></td> </tr> <tr valign="top"> <td></td> <td><p>The location to being used to store the Application's Log file is specified by the <strong>traceloglocation</strong> key.</p></td> <td></td> </tr> <tr valign="top"> <td>Application initialization by the <strong>Designer</strong></td> <td>then, the application was initialized by the values of specified in the application Designer. This was performed by the <strong>InitializeComponent</strong> method, automatically called in the WebApplication Constructor.</td> <td></td> </tr> <tr valign="top"> <td></td> <td><p>The Xafapplication.modules collection is populated by the Modules added to the <strong>Modules</strong>sections in the <strong>Designer </strong>. Each module is a set up. This means, the current webapplication.instance are assigned to the Modulebase.application Property.</p></td> <td> <p> If You need to add a module which is not registered in the <strong> Toolbox </strong>, and thus cannot be added V IA the <strong> Designer </strong>, Use one of the following approaches. </p> <p> Specify the required module name (s) in the application project ' s configuration file. Pass this string as a parameter of The xafapplication.setup method in the <strong> global.seesion_start <!-- Strong--> method. </strong></p><strong> The <p> Add This module to the module, which is contained in your Solution. To does this, use The modulebase.requiredmoduletypes collection. </p> <p> To see code samples of both these approaches, refer to The ways to Register a module topic. </p> <p> You can perform custom actions with a module, in addition to setting the application Object. To does this, override the module ' s modulebase.setup method. </p> </strong></td> </tr> <tr valign="top"> <td></td> <td><p>The Xafapplication.connection property was set to the object of the type specified in the <strong>Designer</strong>' s <strong>connectio N</strong> Section. The connection string is specified in the <strong>Properties</strong> grid, when the <strong>Connection</strong> section is Selected.</p></td> <td><p>You can avoid the use of the Designer applying one of the following Techniques.</p><p>Specify the connection string in the Application project ' s configuration file. Assign this string to the Xafapplication.connectionstringproperty (see this property ' s description).</p><p>Set the Xafapplication.connection and/or Xafapplication.connectionstring property before the Xafapplication.setup Method is Called.</p></td> </tr> <tr valign="top"> <td></td> <td><p>The Xafapplication.security property was set to the object of the type specified in the <strong>Designer</strong>' s <strong>security Section. The authentication strategy to being used by the Security System are specified in the same section. The User type to being used by the security System was specified in the <strong>Properties</strong> grid when the <strong>security</strong> s Ection is Selected.</strong></p></td> <td>The<strong><strong>eXpressApp Framework</strong></strong>Supplies the security system types:<strong><strong>Securitysimple</strong></strong>and<strong><strong>Securitycomplex</strong></strong>. You can set them using the application Designer. If you need to use a security of a custom type that implements the<strong><strong>isecurity</strong></strong>interface, Create and assign it to the Xafapplication.security property in code, before the Xafapplication.setup method is Called. If you need to use a custom authentication strategy or a custom User type, initialize them and the<strong><strong>xafapplication.security</strong></strong>property, before the<strong><strong>Xafapplication.setup</strong></strong>Method is Invoked.<p><p>If you don ' t initialize a security system via the <strong>application Designer</strong> or in code, a <strong>securitydummy</strong> would Be Used. This security type allows all operations with all types of objects. That's why the presence of the security system was invisible when you run an Application.</p></p></td> </tr> <tr valign="top"> <td></td> <td><p>The Xafapplication.applicationname property was set to the value of that was specified in the <strong>Properties</strong> grid when the <strong>Application</strong> section is Selected.</p></td> <td>You can assign a custom value to the Xafapplication.applicationname property in Code-before the Xafapplication.setup met Hod is Called.</td> </tr> <tr valign="top"> <td>The application instance is stored in the current Session.</td> <td>An instance of your WebApplication component are assigned to a Session variable named <em></em>sessionapplicationvariable. This was performed via the Webapplication.setinstance method invoked in the <strong>Global.session_start</strong> method which is AU Tomatically generated in your asp. application Project. When the Session was abandoned or times out, the WebApplication instance is disposed Of.</td> <td></td> </tr> <tr valign="top"> <td>Application initialization by the <strong>Setup</strong>method</td> <td>The Xafapplication.setup method is Called. This was performed by the <strong>Global.session_start</strong>method, automatically generated in your asp.<br>There is several overloads of the <strong>Setup</strong> method. By default, the method without parameters is Called. It leaves the properties that is already initialized as they is and proceeds with the initialization process using DEFAU Lt Values:</td> <td>The <strong>Setup</strong> method with the required parameters, dependent on what objects you need created in a Custo M-to. however, We recommend That's use the approaches presented above, INSTEAD.</td> </tr> <tr valign="top"> <td></td> <td><p>A default Object Space Provider (see Xafapplication.objectspaceprovider) was created using a connection string specified by The xafapplication.connectionstring Property.</p></td> <td>To create a custom Object Space Provider, Subscribe to the Xafapplication.createcustomobjectspaceprovider event before the <strong>Setup</strong>method is Called. alternatively, Pass the required Objectspaceprovider object using the <strong>Setup</strong> method as a parameter.<br>can override the <strong>Xafapplication.createdefaultobjectspaceprovider</strong> method in your WebApplication class Descendant. This method was called when none of the custom approaches to pass an Object Space Provider was Used. This method creates a instance of a built-in <strong>objectspaceproviderthreadsafe</strong> class. You can return a instance of another class that implements the Iobjectspaceprovider Interface.</td> </tr> <tr valign="top"> <td> </td> <td> <p> A default Controllers Manager (<strong> Controllersmanager </strong>) is Created. This object contains a collection of the Controllers, that is declared in the registered Modules. </p> </td> <td> can override the <strong> Xafapplication.createcontrollersmanager </strong> method in your WebApplication class Descendant. This method creates an instance of the built-in <strong> Controllersmanager </strong> class. You can return an instance of another class. </td> </tr> <tr valign="top"> <td> </td> <td> <p> A default Modules Manager (<strong> Applicationmodulesmanager </strong>) is Created. This object contains the Modules collection along and the Modules to being used by the Application. This collection was populated by modules from The xafapplication.modules collection. In addition, the <strong> systemmodule </strong> is added as a default module. </p> </td> <td> can override the <strong> xafapplication.getdefaultmoduletypes </strong> method in your WebApplication class Descendant. This method creates an instance of the built-in <strong> Applicationmodulesmanager </strong> class. You can return an instance of another class. <br> in addition, can override the <strong> getdefaultmoduletypes </strong> method to return modules to be add Ed to a application by default, in addition to the System Module. </td> </tr> <tr valign="top"> <td> </td> <td> <p> A default application Model Differences Store (<strong> filemodelstore </strong>) is Created. </p> </td> <td> If you need to store application Model's differences in a where is different from an XAFML file and you can create a Custom Application Model Differences Store. To does this, the subscribe to the xafapplication.createcustommodeldifferencestore event before the <strong> Setup </strong> method is called, or override the <strong> Createmodeldifferencestorecore </strong> method in Your WebApplication class Descendant. </td> </tr> <tr valign="top"> <td></td> <td><p>The Object Space Provider and Controllers Manager is assigned to the application ' s corresponding Properties:xafapplicati On. Objectspaceprovider and <strong>Controllersmanager</strong>.</p></td> <td>Subscribe to the Xafapplication.settingup event, to customize objects to being assigned to the application Object. Use the event handler ' s parameters to access the required Objects.</td> </tr> <tr valign="top"> <td></td> <td><p>The modules from the modules Manager ' s Modules collection is added to the Xafapplication.modules collection of the Curren T application, since at this step, the latter collection includes the modules that is only added via the application Desi Gner.</p></td> <td></td> </tr> <tr valign="top"> <td></td> <td><p>The Application Model Manager (<strong>Applicationmodelsmanager</strong>) that manages the creation and initialization of the APPL Ication Model is Instantiated.</p></td> <td></td> </tr> <tr valign="top"> <td></td> <td><p>The application Model is Created. internally, the application Model has a layered structure. So in first, the actual layers that comprise the application Model internals is created:</p></td> <td></td> </tr> <tr valign="top"> <td> </td> <td> <p> The zero layer of the application Model is Created. Initially it is Empty. It is filled with the data on demand, during a application ' s life cycle. </p> </td> <td> to extend the application model, pass the required model interfaces via the application modules ' modulebase.exten Dmodelinterfacesmethods. alternatively, you can implement The imodelextender interface In controllers. To modify existing node generators, implement a generator updater and register it via THE&NBSP;MODULEBASE.ADDGENERATORUPDA Ters method of a Module. For details, refer to The extend and Customize the application Model in Code topic. </td> </tr> <tr valign="top"> <td></td> <td><p>A layer for each module used in the application is Created. This layer was filled with data from the <em>Model.DesignedDiffs.xafml</em> file, that contains application Model difference S made in a particular module.</p></td> <td>To modify this layer ' s data, Modify the required module ' s XAFML file. This can is done, for example, via the Model Editor.</td> </tr> <tr valign="top"> <td></td> <td><p>A layer for the application project is Created. This layer was filled with data from the <em>model.xafml</em> file, contains application Model differences made in the Application Project.</p></td> <td>To modify this layer ' s data, modify the Application project ' s Xafml file. This can is done, for example, via the Model Editor.</td> </tr> <tr valign="top"> <td></td> <td><p>Second, all the created layers is wrapped with the master Layer.</p></td> <td>The master layer does not contain any information itself. It serves as a proxy to all other Layers. usually, When you access the application Model, you deal with the master Layer.</td> </tr> <tr valign="top"> <td></td> <td><p>The final state of the application Model was assigned to the Xafapplication.model Property. Note that in asp. net Web XAF applications, The common part of the application Model was represented by a single instance, s Hared between the Users.</p></td> <td>Subscribe to the Xafapplication.setupcomplete event, to create extra objects (helpers, extractors, etc.) after the Applica tion has been entirely initialized.</td> </tr> </tbody> </table><span class="dx-notes-title dx-note-title"><span class="dx-notes-title dx-note-title"><span class="dx-notes-title dx-note-title">Note</span></span></span><p><p>If the current Session has expired, it's restarted, which leads to the re-creation and re-initialization of the Webapplic ation Object.</p></p><p><p>Asp. Application Life Cycle</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service