Skip to content

Struсture and naming convention

devolonter edited this page Mar 4, 2013 · 1 revision

Structure

The collection has a hierarchical structure corresponding to the following scheme:

|- pub
  |- groupname
     |- modulename
        |- …
        |- …
        |- …
        |- modulename.monkey
     |- groupname.monkey
  |- pub.monkey

Users should be able to import the modules in the following ways:

Import pub 'import of all modules collection
Import pub.groupname 'import of all group modules
Import pub.groupname.modulename 'import one module

To do this within each module and group of modules must be a Monkey file with the same name as the module/group of modules which will contain all the necessary imports.

Inside the module folder code can be stored in any convenient form for the developer.

Naming convention

Modules collection doesn’t have strict requirements for naming classes, constants, etc. However, it is desirable to observe the following recommendations:

— Avoid common and frequently used names to prevent conflicts with third-party modules
— It is desirable to place global variables, constants and functions inside the main class of the module
— Stick to the official convention recommended for Monkey code:

  • All-caps case (eg: 'ALLCAPS' ): Constants
  • Pascal case (eg: 'PascalCase' ): Globals, functions, class, methods, properties
  • Camel case (eg: 'camelCase' ): Fields, locals and function parameters
Clone this wiki locally