Skip to content

Examples

Rosario Carvello edited this page Mar 18, 2020 · 18 revisions

Subsystem examples

Into WebMVC package you will find different examples of source code files located under examples folder. All these examples are organized into the following subsystems:

  • examples (main subsystem)
    • about (it contains a simple demonstration of coding a source code information helper)
    • cms (it contains general examples about showing contents by using WebMVC)
    • db (this subsystem contains some DB related examples)

As we described in the previous page a subsystem, in WebMVC, is identified at two levels:

  1. a physical level by pathname, for example, the pathname examples/cms identify the subsystem cms which is contained into the main subsystem examples;
  2. a logical level, that you can use for referring it in your source code, by namespace, in this case, is the name examples/cms (equivalent to its pathname).

For each subsystem, WebMVC uses a directory to physically store all its classes and uses a namespace to refer each class when it needs to be instantiated and executed; directories and namespaces must have identical names that are conventionally written in lowercase.

In conclusion, there are now two decomposition levels when writing code with WebMVC:

  • First is the MVC decomposition (directories: controllers, models, views and templates)
  • Second is provided by the structure of the application subsystems. Inside those two levels live each WebMVC assembly, a logical definition for representing with a unique name the aggregation of the model, view, controller and, template.

Note that we have a replica of the subsystem application names within the models, views, and controllers directories as well as for the templates directory. In the minierp software, the initial application domain decomposition is made by the subsystems crm, and manufacturing; the latter comprises the class Inventory. The directory controllers is the root directory from which all application controllers for the defined subsystems can be invoked. This is because in WebMVC the directory controllers is the entry point to access application software functionalities.

Clone this wiki locally