Creating module in ELMA

Typical Structure

Typically, a module has three parts:

  • Server part (back end) – An assembly of the Class Library type that contains object models, managers and other global services (for example, privileges);
  • Web part (front end) - An assembly of the Web Application type that is connected as an Orchard module and is located in the Modules subfolder of the main Web Application
  • Designer module -  An assembly of the Class Library type that adds or changes the logic in ELMA Designer (this module is not a required one and is added rarely) 

Thus, the structure for the creation of a new module looks as follows: 

  • Extensions\Modules\<Your module, server part>
  • Applications\BPM\EleWise.ELMA.BPM.Web\Modules\< Your module, web part >
  • Extensions\DesignerModules\< Your module, Designer part >

Naming rules

There are certain rules that you have to follow when naming a module:

  • All assemblies and namespaces must be named in English.
  • The module must contain the root namespace that refers to your company and product: ELMA.
  • When naming the server assembly, a logical English name of the module must be added. It is best to use the plural (referring to an entity). For example, in case of a Project Management module, the logical name would be Projects (referring to the Project entity), therefore the name of the assembly would be ELMA.Projects
  • When naming the web module assembly, you need to add the Web postfix to the server assembly name: ELMA.Projects.Web
  • When naming the Designer module assembly you need to add the Design postfix to the server assembly name: ELMA.Projects.Design

Folder and namespace structure

For better integrity and visibility, it is best to use a certain folder structure in both module parts. 

Server assembly

Here the structure is rather simple:

  • \Models\ - this folder is for all the models (entities and enumerations) of your module
  • \Managers\ - this folder is for all the entity managers specific to the module
  • \DTO\ - if you are writing a Designer module, store all the models for visualization and mapping in this folder
  • \Types\ - if you have your own data types, store them here
  • \ - the rest (services, extensions, handlers) may be easily stored in the project root since this code is reusable
  • \<Your Folder> - of course, if you need to separate a certain block of your module, you may create your own folders and namespaces.

Always remember, that this code might later be used by the customer or by other developers, and they should have no trouble finding a class that they might need.  

You can find more information in the article Creating a server module for ELMA.

Web part

For the web part, the folder structure is rather similar to the typical ASP.NET MVC project structure.

You can find more information in the article Creating a server module for ELMA.

Designer part

The folder structure of the designer part is described in the article Creating a server module for ELMA