10 things reading list …

good Java practices from trenches

1) allocating/freeing; @Before/@After; super  => when implementing logic using before/after, allocate/free, take/return semantics

2) when Providing SPI rememeber the context or the parameter object

3) avoid returning anonymous, local or inner classes => they have reference to the outer class (Make it static or regular top level class)

4) Think of SAM’s (Single Abstract Method “Type” a.ka. Functional Interface)

5) Use Optional more often.

6) Never return null arrays or lists from API methods.

7) Functional vs Stateful API’s

8) short circuit equals()

9) Try to qualify your methods with final or private more often.


Tips for “better” using Java and SQL

1) UNION (actually does Union of Distinct elements – first sorts then compares next element to get rid of dupes) vs UNION ALL (Faster if you can process duplicates).

2) JDBC can be used for paging results.

3) profile your JOIN queries (rarely you need to do it in memory).

4) batching inserts will enhance performance.



10 books for Advanced level:



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s