Skip to content

Coding guidelines

Nikos Kefalakis edited this page Nov 25, 2013 · 8 revisions

Namespaces

Trunk and branches

Sources must be prefixed by the following namespaces.

  • Java: org.openiot
  • Bundles symbolic names: org.openiot
  • JMX ObjectNames for end-to-end management: org.openiot:type=component,name=concern
  • XML (XML Schema) : urn:org:openiot
  • WebServices (WSDL, ...) : TODO

Sandboxes

  • Java : org.openiot.sandbox
  • Bundles symbolic names : org.openiot.sandbox
  • XML (XML Schema) : urn:org:openiot
  • WebServices (WSDL, ...) : TODO

Sub project group and maven artifact ids

Names and ids must be prefixed by the following namespaces.

  • Group ID: org.openiot
  • Artifact Id: [module].[functionality] (i.e. scheduler.core)
  • Bundle Name : [groupId].[artifactId]
  • Project Name: [artifactId]

Files

Two mandatory files (NOTICE and LICENSE) must be provided in each project directory

  • NOTICE contains the description of the dependencies and their licenses.
  • LICENSE contains the license text.

Those files should automatically added in the artifact after the package phase

NOTICE file

Example of a Notice File

Copyright 2011-2014 OpenIoT Project
https://github.com/OpenIotOrg/openiot/wiki  

I. Included Software

This product includes software developed at
The OpenIoT Consortium (http://openiot.eu/).
Licensed under the LGPL v3.0.

II. Used Software

This product uses software developed at
the FooBar project (http://code.foo.org/bar).
licensed under the Apache License 2.0.

This product uses software developed at
the TicTac project (http://code.tic.org/tac).
licensed under the LGPL v2.1.

III. License Summary
- LGPL v2.1

LICENSE file

A copy of the license file that should be provided with every OpenIoT library distribution Details are provided in the [chapter|https://github.com/OpenIotOrg/openiot/wiki/Coding-guidelines#license-disclaimers) below.

Beginning comments

All source files (Java, XML, ...) must begin with the comments shown in the following code sample below.

Code obligatory notices:

/**
 * Copyright (c) 2011-2014, OpenIoT
 *
 * …………License Disclaimer……………..
 *
 * Contact: OpenIoT mailto: info@openiot.eu
 */

/**
*
*<File Documentation/Description>
*
 * @author <AuthorName> (<author alias>) e-mail: <author_e-mail>@mailserver.com
 *
 */

Checkstyle

TODO

License Disclaimers

OpenIoT uses LGPL 3.0 so it should provide these terms and conditions . To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found

/**
*    Copyright (c) 2011-2014, OpenIoT
*    
*    This file is part of OpenIoT.
*
*    OpenIoT is free software: you can redistribute it and/or modify
*    it under the terms of the GNU Lesser General Public License as published by
*    the Free Software Foundation, version 3 of the License.
*
*    OpenIoT is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU Lesser General Public License for more details.
*
*    You should have received a copy of the GNU Lesser General Public License
*    along with OpenIoT.  If not, see <http://www.gnu.org/licenses/>.
*
*     Contact: OpenIoT mailto: info@openiot.eu
*/

If you have copied code from other programs covered by the same license, copy their copyright notices too. Put all the copyright notices together, right near the top of each file.

You should also include a copy of the license itself in the distribution of your program (attached) usually in the first folder of your project, usually in a file called COPYING.LESSER.txt. Please note that, since the LGPL is a set of additional permissions on top of the GPL, it's important to include both licenses so users have all the materials they need to understand their rights COPYING.txt

Clone this wiki locally