Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coding Practices for Java
06-17-2009, 11:57 AM (This post was last modified: 06-17-2009 11:58 AM by shazin.)
Post: #1
Coding Practices for Java
There are two main practices which are, if followed can make your
java code much more optimal, flexible and less error prone.

Those are;

  1. Never create a Has-A relationship with an implementation, Use an interface whenever possible. This is because if you use a Has-A relationship with an implementation your code will be tightly coupled with that implementation which is not good for maintenance.
  2. Use Object composition over inheritance, This will make your code more flexible than code with inheritance.

Shazin Sadakath
Bsc (Hons) Software Engineering (UG)
SCJP 1.5
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


Contact Us | Coder Passion | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication | Site Map