本文发表在 rolia.net 枫下论坛1. Either have the usefulentry implement comparable interface or generate a independent comparator class and use arrays.sort to sort the list of object.
2.It is not a good idea to extend vector here. Naturally, the connection pool should hide the truth that you are using vector or hashtable or any other array-alike method to hold the connection. However, if you extend the vector, anybody would be tempted to use the vector.add method to add a connection, which is probably the intension of the creator of connection pool.
3.java.lang.string.replaceAll. However, this method is only available on jdk1.4 or later. Not in jdk1.2
4.It doesn't check the null value so the second statment is probably going to throw nullpointerexception. The third statement should check the unparsable integeter exception.
5.it.remove should be called instead the map.remove
6.private static string LAST_NAME="last_name"
if (person !=null) && ("".compareTo(person.getLastName)==0)
new properties().put(LAST_NAME, person.getLastName();
16. AWT can be used to achieve complex GUI. But not many people use it though
17.End of function after the mousedown event is triggered.
if (window.variable) should be doing the check.
A modaldialog is actually a popup dialog when user can't go to other windows or control before finishing the function in dialog box. The alert, prompt and confirm are 3 examples.
Don't understand the last question
18. The two methods need a header tells the parameter, return value and any possible exception.
19. It doesn't make sense. The test only return true when b and p refer to same object, which wouldn't never happen in this case.
20. Perhaps they want the business object be transfer between different tiers, which resides on different machine.
21. unit test is normally used to test each class's public method and see if the class can turn out the expected returns. use junit package. Create a testcase, call assert something methods. Optionally, create testsute, add all testcase into it. Use junit built in statndalone application to run through all test cases.
7.The tomcat doesn't have datasource(?) Tomcat is not scalable. Tomcat doesn't have ejb container unless combound with jboss. Tomcat performance is bad.
8.To have better maintainability. Because GUI people wouldn't understand java code that messup with html tags.
9. In this case, b is enough. Because those elements actually won't be extended.
10.a is much better. The column is meaningful. It can save storage space. Possible index can be created while the solution b has different variable type. If there is a relatively predefined reference data and you are really in flavour of highly normalization. Choose b. But not in this case, since the table is frequently updated.
11. The business logic is built in database side if using sp. That makes maintainence difficult. The logic is bound into one plateform. The sp should only be used in some special case, such as for better performance.
12. that's too much.
13.framework. Just imaging...
14.that really takes time
15.use singleton. Have it initialized when servlet startup
6.state更多精彩文章及讨论,请光临枫下论坛 rolia.net
2.It is not a good idea to extend vector here. Naturally, the connection pool should hide the truth that you are using vector or hashtable or any other array-alike method to hold the connection. However, if you extend the vector, anybody would be tempted to use the vector.add method to add a connection, which is probably the intension of the creator of connection pool.
3.java.lang.string.replaceAll. However, this method is only available on jdk1.4 or later. Not in jdk1.2
4.It doesn't check the null value so the second statment is probably going to throw nullpointerexception. The third statement should check the unparsable integeter exception.
5.it.remove should be called instead the map.remove
6.private static string LAST_NAME="last_name"
if (person !=null) && ("".compareTo(person.getLastName)==0)
new properties().put(LAST_NAME, person.getLastName();
16. AWT can be used to achieve complex GUI. But not many people use it though
17.End of function after the mousedown event is triggered.
if (window.variable) should be doing the check.
A modaldialog is actually a popup dialog when user can't go to other windows or control before finishing the function in dialog box. The alert, prompt and confirm are 3 examples.
Don't understand the last question
18. The two methods need a header tells the parameter, return value and any possible exception.
19. It doesn't make sense. The test only return true when b and p refer to same object, which wouldn't never happen in this case.
20. Perhaps they want the business object be transfer between different tiers, which resides on different machine.
21. unit test is normally used to test each class's public method and see if the class can turn out the expected returns. use junit package. Create a testcase, call assert something methods. Optionally, create testsute, add all testcase into it. Use junit built in statndalone application to run through all test cases.
7.The tomcat doesn't have datasource(?) Tomcat is not scalable. Tomcat doesn't have ejb container unless combound with jboss. Tomcat performance is bad.
8.To have better maintainability. Because GUI people wouldn't understand java code that messup with html tags.
9. In this case, b is enough. Because those elements actually won't be extended.
10.a is much better. The column is meaningful. It can save storage space. Possible index can be created while the solution b has different variable type. If there is a relatively predefined reference data and you are really in flavour of highly normalization. Choose b. But not in this case, since the table is frequently updated.
11. The business logic is built in database side if using sp. That makes maintainence difficult. The logic is bound into one plateform. The sp should only be used in some special case, such as for better performance.
12. that's too much.
13.framework. Just imaging...
14.that really takes time
15.use singleton. Have it initialized when servlet startup
6.state更多精彩文章及讨论,请光临枫下论坛 rolia.net