Followings are my personal thought bubbles on java programming
[b]1. Just don't put any instance variables into your Runnable[/b]
[b]2. Be carefull when you're using 'valotile'[/b]
[b]3. Use annotation as far as possible[/b]
[b]4. If possible,anyway,use annotation to substitude of configuration file[/b]
[b]5. Would Some cohesive functions within your domain scope should be coded in your domain object[/b] [For migration || Reuse]
--------- period
[b]6. Try your best to cache your object with the modifier
'private static'[/b]
[b]7. Make the utmost use of 'Component'[/b]
[For Reuse || migration ]
Such as 'Judge Component'. 'Code Logical Component'
[b]8. Some big or long-standing object should use
the Keyword 'SoftReference'[/b]
[b]9. One class should provide simplified task[/b],
so that you can avoid of high-co-relation [避免耦合]
[b]10.Use proxy/adapter/decorator/template/command/ DPs [/b]
as far as possible
--------- period
[b]11.Avoid of Hard-Code in your code:[/b]
[list]
[*]Use interface [such as GlobalConstants]
[*]Use file [such as properties and xml files]
[/list]
[b]12.There should be serialization and De-serialization method
within any of Exception class[/b]
[b]13.Your code should be robust:[/b]
[list]
[*]catch every exception [in order to do some special process
according to the detail Exception]
[*]you must take runtime Exception into account:
such as MathException [ => multiplying two big int]
[/list]
[b]14.closure of object:[/b]
[list]
[*]if an object will never be used = > obj = null; then return;
[*]close connection
[*]close file
[/list]
[b]15.Every method should check-up the parameters , when check-up failed
the method should throw some particular Exception[/b]
[list]
[*]the parameter should be final as far as possible
[*]consider the class casting
[/list]
--------- period: 09/02,2010 11:30 am
[b]1. Just don't put any instance variables into your Runnable[/b]
[b]2. Be carefull when you're using 'valotile'[/b]
[b]3. Use annotation as far as possible[/b]
[b]4. If possible,anyway,use annotation to substitude of configuration file[/b]
[b]5. Would Some cohesive functions within your domain scope should be coded in your domain object[/b] [For migration || Reuse]
--------- period
[b]6. Try your best to cache your object with the modifier
'private static'[/b]
[b]7. Make the utmost use of 'Component'[/b]
[For Reuse || migration ]
Such as 'Judge Component'. 'Code Logical Component'
[b]8. Some big or long-standing object should use
the Keyword 'SoftReference'[/b]
[b]9. One class should provide simplified task[/b],
so that you can avoid of high-co-relation [避免耦合]
[b]10.Use proxy/adapter/decorator/template/command/ DPs [/b]
as far as possible
--------- period
[b]11.Avoid of Hard-Code in your code:[/b]
[list]
[*]Use interface [such as GlobalConstants]
[*]Use file [such as properties and xml files]
[/list]
[b]12.There should be serialization and De-serialization method
within any of Exception class[/b]
[b]13.Your code should be robust:[/b]
[list]
[*]catch every exception [in order to do some special process
according to the detail Exception]
[*]you must take runtime Exception into account:
such as MathException [ => multiplying two big int]
[/list]
[b]14.closure of object:[/b]
[list]
[*]if an object will never be used = > obj = null; then return;
[*]close connection
[*]close file
[/list]
[b]15.Every method should check-up the parameters , when check-up failed
the method should throw some particular Exception[/b]
[list]
[*]the parameter should be final as far as possible
[*]consider the class casting
[/list]
--------- period: 09/02,2010 11:30 am