- Code to interface, mmmm still need to get habituated with this.
- Write test cases.
- Never mutate the object passed by the parameter ie when we get list as an method parameter do not alter the list in that method , and when we need too then just make a local copy of it and work on the locally created object.
- When wrapping up the exception do wrap with cause ie try {} catch (SomeException e) { throw new WrapException(e.getMessage()) {}...never do this, we are eating up the actual cause but instead do "throw new WrapException(e)" in the catch.
- Avoid String splitting for business logic flow. like String str1 = getSomeText(); if("Target".equals(choice.split("-")[0].trim()) { //do this....} else {// do that...}
Some other things I want to remember and I forget all the time
- Apache Tomcat is servlet container, it implements java servlet & jsp spec and provides pure java HTTP web servlet environment.
- 'Apache Web Server' is C-Lang based HTTP web server.
1 comment:
Eating up the exceptions is really annoying!
Post a Comment