Saturday, April 1, 2017

Executor Service Example, for invoking multiple calls Parallelly

You may need to run a particular task (that can run independently) in parallel fashion in order to improve performance, or lets say, simulate a method call in multi-threaded environment:

Here is a example code snippet to do so:


Opinion on documentation

When to do documentation:

  • Nuggets of information, need to be referred by more people or more frequently - for example, Test Data, Deep links in different environment etc. 
  • It can speed up a new joiner's on-boarding. For example, some basic knowledge using which a developer can jump-start into building new feature and deploy stuff.
  • Something you feel you are likely to forget for example, an assumptions you were forced to made for whatever reason. 

When it comes to an API is used by different sets of users/clients, it needs to be documented properly. Otherwise, your consumers will either assume things, or, they will keep coming back to you with trivial questions, and that can result in low productivity on both provider's and consumer's end.

Look out for overdoing of documentations - its not good - rather, sometime its a waste of time and energy.


Prototype

Prototype is another creation pattern. Intent:  - Intent is to create objects by cloning existing instance  - Specify the kinds of obj...