-
Notifications
You must be signed in to change notification settings - Fork 16
Examples
Into WebMVC package you will find different examples of source code located under the examples subfolder.
They give you a demonstration of the main WebMVC functionalities, as well as, how to organize software into subsystems. Subsystems of the provided examples are organized as follow:
-
examples- which is the main subsystem -
-
about- it contains a simple demonstration of coding a source code information helper
-
-
-
cms- this subsystem contains general examples about how showing contents by using WebMVC
-
-
-
db- this subsystem contains some DB related examples
-
Below is the directory/files structure:
.
Rember that, due to the MVC design pattern, you will find a replica of examples folders/files structure also under models, views and, templates folders.
You can run a demo from here
As we just described in the previous page a subsystem, in WebMVC, is identified at two levels:
- a physical level, the pathname. For example, the pathname
examples/cmsidentify the subsystemcmswhich is contained into the main subsystemexamples; - a logical level, the namespace. In this case, it is the name
examples/cmsand must be equal to its pathname. Namespaces are used in source code for structuring and organizing naming conflicts.
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, you need to take in mind that there are two decomposition levels when writing code with WebMVC:
- First is the MVC decomposition (directories: controllers, models, views and templates)
- Second is provided by the application subsystems, that is a folders/files structure you need to replicate within the controllers, models, views, as well as, for the templates directory.
Also, remember that the directory controllers are the root directory from which all application controllers for the defined subsystems can be invoked. This is because in WebMVC the directory controllers are the entry point to access application software functionalities.
Inside all levels live each WebMVC assembly, a logical and physical name for representing, aggregation of the model, view, controller and, template and you can use for naming classes and template.