Defining commonly used design pattern with their examples in java and javascript.