The Official BLOG and Wiki for CustomMode.com
[ start | index | login ]
start > Coding Conventions

Coding Conventions

Created by dmitry. Last edited by dmitry, 2 years and 157 days ago. Viewed 178 times. #1
[edit] [rdf]
labels
attachments

Introduction

This document contains information related to source code standards. These standards and guidelines will be used as a reference for source code artifacts created in the EA construction project.

Java Coding Standards

We encourage to use Sun's coding standard because of there wide community acceptance.

Naming Variables

Variable name should be fully spelled out. Use of <CTRL>+<SPACE> hot key combination in Eclipse can be very helpful. The variables declared in different scope should be preceeded with a meeningful prefix (see below).

Variable prefixes

Variable typePrefixExample
FieldffExampleVariable
Static FieldssExampleVariable
ParametersppExampleVariable
Local VariablesllExampleVariable
Eclipse can support variable prefixing for different scope. Go to <window>/<preferences>/<java>/<code styles> menu in Eclipse and use put f for Fields, s for Static etc…

Formatting code

Organising imports

We rely on Eclipse support for organising imports. <CTRL>+O does the job.

Naming Interface/Implementaition pairs

The interface name should be spelled out, the implementing class name should be suffixed with Impl at the end. For example:
  • interface BusinesTierController
  • class BusinesTierControllerImpl implements BusinesTierController

Naming Architectural components.

This rule should make it easier to know what some of the implementation details and/or architectural responsibilities of the software components are by just looking at their names.

Types or architectural components:

  • Data access object
  • Domain Object mapped to database through Hibernate
  • Spring managed bean with declarative transactions enabled
no comments | post comment
custommode.com | ©2000-2005
webmaster at custommode dot com