JSON – Java


Feed JSON object from URL to following URL.
This gives Java class.


Using this Java class, build mock service.
Note: This is having issues when there are nested elements

This is well sophisticated way to convert JSON to Java Classes.


Note: Before you give JSON as input, find null values and make them some values. So that they will picked up and becomes variables. Otherwise it will cause trouble when it see values during run time.






This is similar to XPath.
Very useful when we need only few elements.


Java Transaction API

Transaction: an exchange or interaction between people.

Native Support

Third Party Support

1. If we are doing credit card transaction, we need to do reverse swipe separately (We can write separate task and execute, but to be careful and need to handle, if we fail to perform reverse swipe).
2. If credit card transaction failed, we can’t do it again and again.
We need to understand and apply common sense on how to deal with it.

What is the Java equivalent for LINQ?

jOOQ: http://www.jooq.org
JINQ: http://www.jinq.org
JaQue: http://github.com/TrigerSoft/jaque
JaQu: http://www.h2database.com/html/jaqu.html
Linq4j: https://github.com/julianhyde/linq4j
Quaere: http://quaere.codehaus.org/
QueryDSL: http://www.querydsl.com
JSR-341: http://java.net/projects/el-spec/pages/CollectionOperations

Reference: http://stackoverflow.com/questions/1217228/what-is-the-java-equivalent-for-linq

Thanks to Lukas Eder

Ref: http://blog.jooq.org/2013/07/01/linq-and-java/
1. These are tightly coupling with database and may cause brittleness down the line.
2. Performance fine tuning is tough.
3. Saves time and lines of code and increases productivity.
4. Better to write stored procs and use them.
5. C# LINQ looks good, but didn’t liked it.


Commons Validator

Many times Developers are tempted to write their own validations.
If using Java, better to use “Commons Validator”


Few Points:
1. Always check for null. Don’t assume that customer will provide data.
2. Always check for boundary values….i.e min/max/…etc
3. Better to associate Error Messages with Error Codes. Pretty much required for Automation.
4. Externalize Strings to support multi lingual support
5. If not doing anything, don’t catch exceptions.
6. Don’t swallow exceptions….preserve the stack trace
7. Don’t convert exception A to exception B
8. Use Sonar and fix the values
9. Define constants separately….if possible configurable in future.