<commit_before>---
title: Backend Coding Standards
authors: abonas, gina, lhornyak
wiki_title: Backend Coding Standards
wiki_revision_count: 12
wiki_last_updated: 2015-05-20
---

# Backend Coding Standards

This page is a collection of coding standards in the ovirt engine backend. Not all of these standards are properly maintained, they are more like 'guidelines'

### Java code conventions

Java code style conventions and best practices should be applied in the project.

<http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html>

### Vdsm coding guidelines

<http://www.ovirt.org/Vdsm_Coding_Guidelines>

### RowMapper singletons

RowMappers should have a single instance e.g.

      private final static class FooRowMapper implements ParameterizedRowMapper`<Foo>` {
        public final static FooRowMapper instance = new FooRowMapper();
        public Foo mapRow(ResultSet rs, int rowNum) {
          //and so on...
        }
      }

So you do not have to instantiate the rowmapper all the time.

# To be cleared

### Logger

Seems like there is no clear agreement on how the loggers should be declared. What is known is that it should be the 'compat' logger.<commit_msg>Backend Coding Standards<commit_after>---
title: Backend Coding Standards
authors: abonas, gina, lhornyak
wiki_title: Backend Coding Standards
wiki_revision_count: 12
wiki_last_updated: 2015-05-20
---

# Backend Coding Standards

This page is a collection of coding standards in the ovirt engine backend. Not all of these standards are properly maintained, they are more like 'guidelines'

### Infra Bash Script coding guidelines

<http://www.ovirt.org/Infra_Bash_style_guide>

### Java code conventions

Java code style conventions and best practices should be applied in the project.

<http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html>

### oVirt Engine/IDE

[`http://www.ovirt.org/Building_oVirt_Engine/IDE`](http://www.ovirt.org/Building_oVirt_Engine/IDE)` --> see section about engine and Checkstyle`

### Vdsm coding guidelines

<http://www.ovirt.org/Vdsm_Coding_Guidelines>

### RowMapper singletons

RowMappers should have a single instance e.g.

      private final static class FooRowMapper implements ParameterizedRowMapper`<Foo>` {
        public final static FooRowMapper instance = new FooRowMapper();
        public Foo mapRow(ResultSet rs, int rowNum) {
          //and so on...
        }
      }

So you do not have to instantiate the rowmapper all the time.

# To be cleared

### Logger

Seems like there is no clear agreement on how the loggers should be declared. What is known is that it should be the 'compat' logger.
{'fraction_non_alphanumeric': 0.07907497202536368, 'fraction_numerical': 0.011935844834017158, 'mean_word_length': 3.9758812615955472, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5558932', 'n_tokens_mistral': 900, 'n_tokens_neox': 833, 'n_words': 296}