Programming Logics FORUMS

Full Version: Java Tips And Tricks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

JAVA TIPS AND TRICKS

Tips to make your program better
1. Don't make any class file larger than 1000 lines
2. Avoid Using Global Static function, if not possible then put that all function in a separate class.
3. Before starting the project Check out the proper decomposition of classes, interface and function. Practice of making structure then start coding.
e.g All Nouns is the probable candidate for classes and All Verbs are probable candidate for functions. User Interface wherever possible.
4. Always try to features given by java, don't try to write your own code if java provide such thing like StringBuffer, HashMap, ArrayList etc.
5. Always use the System properties handled by java for example. Don't use "\n" u can use
System.getProperty("line.separator");
6. Always Use Java coding convention(if you don't have company specified) and one popular IDE(eclipse/NETBeans etc) for programming.
7. Properly handle exception and their preferred treatment and if possible create a separate Exception Handling class where After Error message that thrown exception will be caught.
8. Avoid use of public data types for any class.

Thanks
Many tips would be available for a JAva then helpful a develop a project thus many tips are as under.
1) Java class as a close implementation of the Builder pattern
2) Use the database schema browser
3) Database class
4) JDBCConnect class
5) Self-composition of the product
The multiple auto modules are messy but function.I could not get any aliased token to work. I made one for am.top.hill.com and tried using that url it always gave me a keyberos token error about the user not being found when I used it. I am not exactly a kerosenes genius obviously.
Reference URL's