Persistate

Application structure

Hide Navigation Pane

Application structure

Previous topic Next topic No directory for this topic  

Application structure

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for the print function Mail us feedback on this topic!  

The applications that Persistate generates follow the industry standard Model-View-Controller architecture.  Because the word view is also used to describe a type of database object, Persistate uses the term User Interface instead, or just UI.  An application in Persistate is called a package.  Each package has a Controller module, a Model module and a User Interface module.

Future Enhancement

For the moment, Persistate generates only a Desktop User Interface module, based on Windows Forms.  A future version of Persistate will generate other types of user interface, such as HTML4, HTML5, XAML and Flash, as well as mobile platforms Windows, iOS and Android.  The Persistate architecture ensures that the Controller module does not know or care about the UI type.

When you process a package definition file, Persistate creates a solution with the name of the package, say MyApp.  It then creates a project in the solution for each module.  For the model and controller modules these will be called MyApp.Model and MyApp.Controller respectively.  The desktop UI module is put in a MyApp.Desktop project.  All of these produce class library DLLs.

The following diagram shows the linkages between these modules.

Persistate application structure

Persistate application structure

Persistate also generates a project called MyApp.Startup.  This project generates an executable file, which is used only when you want to run your application in stand-alone mode with a desktop user interface.  It contains a single small class, generated when you create the package, which serves only to initialise the run-time and start up the UI.

Processing the definition file generates code in all three of the main modules.

In the Model, you get .Net types corresponding to your defined classes, containing properties and methods to access all their defined members.  You get two partial files for each class, one containing the generated code and the other in which you can add your own code to the class.  For details, see Model classes.
In the Controller, you get .Net classes corresponding to your defined operation groups, containing stub methods for each of their defined operations.  You write your application code starting from these methods, using access to the Model types and members, and to the User Interface abstract class.  For details, see Controller classes,
In the User Interface, you get .Net classes containing forms and grids corresponding to the Layouts in your package.  These can be either the default Layouts created by the Persistate Generator application, or those you created manually.  You also get .Net classes corresponding to your defined operation groups, containing methods for each operation.  With these you can control the "presence" of your operations in the UI - whether they are enabled, disabled or invisible. For details, see User Interface classes.