Cmobilecom AF 5.19 Developer Guide

2 Architecture

Cmobilecom AF is a Java client/server full-stack application framework for building cloud native applications supporting multitenancy.


          Server/Cloud                                              Client
|----------------------------------|    View Bindings     |--------------------------|
|         Logical View             |----------------------|     Target Platforms     |
|----------------------------------|    |                 |                          |
|     InstanceTypes/Instances      |    |                 |--------------------------|
|       Modules (app logic)        |   API
|----------------------------------|    |
|         Persistence              |    |
|        Cmobilecom JPA            |-----
|----------------------------------|

A server consists of one or more instance types (system or non-system). For each instance type, one or many instances can be created except the singleton system instance. The server is multitenant, and instances are tenants with their own logical persistence units.

|--------------------------------------------------------------------------------------|
| Server                                                                               |
|                                                                                      |
|      |---------------------|                   |-----------------------------|       |
|      |                     |                   |  InstanceType A             |       |
|      | InstanceType System |                   |  (Separate DataSources)     |       |
|      |     (singleton)     |                   |                             |       |
|      |                     |                   |  Instance A1                |       |
|      |---------------------|                   |  Instance A2                |       |
|                                                |-----------------------------|       |
|                                                                                      |
|                           |----------------------|                                   |
|                           |  InstanceType B      |                                   |
|                           |  (Shared DataSource) |                                   |
|                           |                      |                                   |
|                           |  Instance B1         |                                   |
|                           |  Instance B2         |                                   |
|                           |----------------------|                                   |
|                                                                                      |
|--------------------------------------------------------------------------------------|

Instance Type

An instance type is defined to contain modules that define data model, application logic and logical view.
|-----------------------------------------------------------------------|
| InstanceType                                                          |
|                                                                       |
|      |-----------------------|        |-----------------------|       |
|      | Module A              |        | Module B              |       |
|      |    Data (entities)    |        |    Data (entities)    |       |
|      |    Application Logic  |        |    Application Logic  |       |
|      |    Logical View       |        |    Logical View       |       |
|      |-----------------------|        |-----------------------|       |
|                                                                       |
|-----------------------------------------------------------------------|
Entities of modules in one instance are mapped to the same logical persistence unit called "DataAccessUnit". An InstanceType also has its own DataAccessUnit. That is, entities in the InstanceType DataAccessUnit are not associated with any instances. A DataAccessUnit is mapped to a separate or shared persistence unit.
InstanceType System: (System_DataSource) InstanceType A: (DataSource_Per_Instance) InstanceType B: (Shared_DataSource)
Multiple instances No. Singleton called "system instance". Yes. e.g., Instance A1, Instance A2 Yes. e.g., Instance B1, Instance B2
Multitenancy One instance: one data source. Instance type itself and each instance has its own data source. Instance type itself and all its instances share one data source. Sharing tables using tenant discriminator column. If a discriminator column is null, the corresponding entity is associated with the instance type.
Query Data Scope One instance InstanceType itself or one instance. Can not query data of all instances. InstanceType itself, one instance or all instances.

For system XML configuration of instance types, see System Configuration.

Module

Cmobilecom AF is module pluggable. A module has data model, application logic and logical view. See Module Development for details.

Logical View

|-------------------------------------------------------------------------------|
|  ContainerBean                        | ------------|                         |
|                                       |  DialogBean |                         |
|                                       |-------------|                         |
|                                  |--------------|                             |
|                                  |  DialogBean  |                             |
|                                  |--------------|                             |
|                                                                               |
|      |-----------------------------------|       |--------------------|       |
|      | Region N1                         |       | Region N2          |       |
|      |                                   |       |--------------------|       |
|      |    |-------------------------|    |                                    |
|      |    |  Bean                   |    |       |--------------------|       |
|      |    |    MenuBean             |    |       | Region N3          |       |
|      |    |      (MenuNodes)	      |    |       |--------------------|       |
|      |    |    EntityBean           |    |                                    |
|      |    |      (EntityProperties) |	   |       |--------------------|       |
|      |    |    EntityListBean       |    |       | Region N4          |       |
|      |    |      (EntityProperties) |	   |       |--------------------|       |
|      |    |      (PaginatorMenu)    |    |                                    |
|      |    |    Nested Beans         |    |                                    |
|      |    |    Partial Behaviors    |    |                                    |
|      |    |-------------------------|    |                                    |
|      |-----------------------------------|                                    |
|                                                                               |
|-------------------------------------------------------------------------------|

Directory Structure

In addition to data persisted in database, certain data such as large objects can be persisted in file system.
[cmobilecom.home]
     |-- dau/
           |-- www/                                        <-- global sites
           |     |-- main/
           |
           |-- system/                                     <-- system instance rootDir (DataAccessUnit)
           |      |-- www/                                 <-- system instance sites
           |      |     |-- main/
           |      |
           |      |-- modules/                             <-- module data of system instance
           |
           |-- InstanceType1/                              <-- instanceType rootDir (DataAccessUnit)
                 |-- www/                                  <-- instanceType sites
                 |     |-- main/
                 |
                 |-- modules/                              <-- module data of instanceType
                 |
                 |-- instances/
                            |-- www/                       <-- instance parent sites
                            |     |-- main/
                            |
                            |-- 00/00/00/18/               <-- instance rootDir (DataAccessUnit)
                                 |-- www/                  <-- instance sites
                                 |     |-- main/
                                 |
                                 |-- modules/              <-- module data of instance
For a DataAccessUnit, module large objects(e.g., images, videos) can be stored under its module directory. Site inheritance hierarchy can be created under various www directories. See Website module docs for details.
OverviewInstallationFrames / No Frames