Page Count

Wednesday, July 27, 2016

Programming Guide Lines

1. Modularization

Do not write the whole logic code in one block/function instead delegate the each and individual responsibility to each function. For example if you are converting one Date time format to another write this logic in Utils and use it. It might be useful in other place as well.

And if you come across any common piece which is repeated in you logic put it in a function call where ever needed. This is basic fundamental rule.

2.Single Responsibility.

Always delegate single responsibility to one block/function of code. Don't mess multiple operations in a single block/function. And make sure block/function of name should ideally match to what it actually does.

3. Name Justification

Always declare the class, method or variable names based on its purpose. And don't use any shorter names.
The one who reads your code should get idea what actually it does.

RESTful Service Java Implentaions


Jax RS API and its implementation Clarification

  1. The API does not provide any implementation code (concrete classes that do the actual processing). The API only specifies interfaces, annotations, exceptions. There can be concrete classes with some very basic, core behavior. The idea of standard APIs, like JAX-RS, is to give developers something to code against regardless of the underlying platform and implementation.
  2. Jersey, RestEasy and CXF are the implementations - it includes many concrete classes that actually handle the business promised by the API according to JSR  (Java Specification Request) 311. In JAX-RS case - it handles requests and responses.

Apache CXF - CXF is the implementation from Apache Group.

Jersey - the JAX-RS Reference Implementation from Sun.
We're using Jersey as its packed full of features (e.g. WADL, implicit views, XML/JSON/Atom support) has a large and vibrant developer community behind it and has great spring integration.
RESTEasy - JBoss's JAX-RS project. 
If you use JBoss/SEAM you might find REST easy integrates a better option.

Note: Since Jboss acquired by RedHat Linux, Jboss origination has re-named the open Source Jboss to Wildfly and started releasing the version of Jboss after 7.0. Now the current Wildfly (Jboss) version is  10. Check for more info at http://wildfly.org/downloads/

Now RedHat Jobss now called as Jboss EAP and enterprice version is now licensed.
 https://www.redhat.com/en/eap-calculator