The Genro way of developing management and business software is strongly structured and modular. This approach suits the common scenario where different clients have similar but not always identical requirements. Writing many applications ad hoc is a very time consuming activity. It is more efficient to define an application as a collection of one or packages. These packages may be used by multiple applications, for broad requirements, and be sub classed to provide specific requirements per client.
Package
A package is an atomic unit of developement. It contains all the business logic, data model and user interface about a particular class of management problems (i.e. accounting, stock management, planning, etc). A package may be written as an ad hoc solution or as a standard and reusable product, eventually customized for each application instance.
A package must contain a python module main and may contains following directories.
- model: other elements about database's structure and tables' mixins.
- procedures: batch procedures and bin
- lib: business logic and library modules
- webpages: pages made with GenroWeb
- wxpages: pages made with GenroWx
In the module, main is redefined as the mixin class Package that implements the methods: config_db, config_attributes and the other general package configurations. We can define a mixin class Table (where methods are included that are common to all the package's tables) and some classes Table_tablename (in order to add methods to a given table).
An object GnrPackage is related to each package of the instance of the application. GnrPackage configures the package defining the abstract methods implemented by the mixin classes. There is also a class SqlPackage representing the object package in the database hierarchy. A SqlPackage is a collection of the SqlTables defined and managed by the package.
Application
Since we introduced standards at package's level, we could say that an application consists of a collection of one or more packages. We use the term instance of application instance meaning the application's deployment on the customer's server. Each instance collects different packages eventually configured and customized.
A configuration file called instanceconfig.xml must be defined; it sets the parameters for the database connection and lists the different packages used by specifying also the path that identifies the position in the filesystem.
The application instance can also contain a custom directory with the package's custom folders. Each customization directory is structured as the redefined package and it has a custom module that redefines the package's main module.
An application instance configures and works on one database whose model will be the union of each package's data model. The resulting database is divided in packages that are tables collections. Relations between different packages' tables are possibile. For example a video rental application that is composed by a package of catalog and a package for members management will have a database model like this one.
Site
A Genro application may have one ore more front-end: a site realized with Genro Web or a desktop app made in WX. We assume that a Genro site may include some applications and that an application instance may be published by different genro sites. A Genro Site, realized with our framework is a directory tree automatically created by a shell bin command. The site publish all the webpages from every package of every application instance. A Genro site also contains all javascript libraries that implements widgets and ajax interaction with application. The site has also a hierarchy of CSS stylesheet that provides the appearance of its pages.
Attachments
- architettura.png (40.5 kB) - added by anonymous 20 months ago.
- archsw.png (52.9 kB) - added by anonymous 20 months ago.
- packagesb.png (23.9 kB) - added by anonymous 19 months ago.
- site.png (23.8 kB) - added by anonymous 19 months ago.
- site2.png (27.0 kB) - added by anonymous 19 months ago.





