Coding Standards
Date: Aug 2014
Level: Basic


Company: Accenture
Question Title: Coding Standards
Language: Java

What are the top few coding standards/code reviews in Java?

Listed below are the top few coding standards for Java:

a) Open Close Principle:Software entities like classes, modules and functions should be open for extension but closed for modifications.

b) Dependency Inversion Principle: High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.

c) Interface Segregation Principle :Clients should not be forced to depend upon interfaces that they don't use.

d) Single Responsibility Principle : A class should have only one reason to change.

e) Liskov's Substitution Principle : Derived types must be completely substitutable for their base types.

f) DRY(Don't Repeat Yourself) - Use the existing code through inheritance,association, aggregation or composition instead of rewriting it.

g) Code should be written for interface

h) Proper exception handling , handling the error or throwing it to the caller according to the requirements

i) The name of the packages,classes,variables,interfaces etc. should be meaningful and according to the organisation standard.
All Questions