Modules

Developing web applications may contain common behaviors, as FAQ, news, guest books, etc.,  that are not all but part of the site. To avoid developing them each time, Netsilon integrates a module architecture that allows to develop components that final application, or other components may use. Developing a module is the same as developing a project: there is no difference. To import a module, use import module option of the site popup menu. If a module needs another module, it will be automatically detected, and you will be asked to confirm import. Imported modules appears in the browser as sub-subsystems. To remove them from the project, just delete the corresponding sub-subsystem.

This is made possible by import / export of business interfaces and web pages:

Only imported or exported file or interface are visible (e.g. usable) outside the module. An exported interface is a realized interface, otherwise it is imported; remember interfaces are classes with the interface stereotype. A file can be imported or exported thanks to its interfacing property. If the module defines a session variable of an imported or exported business interface, this variable will be usable in the project.

To be generable, each imported element must be realized, even if it is located in a sub-subsystem. To do this, use the edit module connections of the site popup menu.

At the left appears the main subsystem, and then each of its imported modules (i.e. sub-subsystems). At the top are presented every connected imported interfaces of the selected subsystem (business interfaces at the left and files at the right). At the bottom are presented each realized (and valid) connections. To change a connection, select the imported interface and click the "Change Identification" button. You just have then to select the right realizing element; only elements that can realize the selected imported element are presented. You can connect an imported business interface to an exported business interface or directly a class if this second one has at the least the same operations (these interfaces are considered as connected for type checking). You can connect an imported file to another non-imported non-static file if they have the same fragment property, (you cannot connect a fragment to a non-fragment), and if the entry context of the second includes at the least the same variable of same type. Note that type checking will tell that connected business interface and their realizing class are equivalent.

When importing a module, you also import its still valid connections. Remember that connections to non-exported elements are lost in that they are not visible in the importing project.

You cannot directly use any exported element of an imported module. To do this, you must define an imported element and connect it to the exported element you want to use.

To create an access to an exported business interface inside a module, you can drag and drop it in a class diagram. This creates a new unrealized interface in the project with all its operations, and connect it to the interface of the module. To create an exported (realized) interface from a class, use the make exported interface of its popup menu. You cannot inherit of an imported interface, but you can make links to it.

While writing a module, you will certainly want to test before distributing it to other projects. Then, you will certainly connect imported elements to non-exported ones. To avoid generation while imported, you can mark non-exported connected files as for test purpose. This file will be generated only when it is part of the main subsystem.

Previous    Summary    Next