David Newton wrote:Start by refactoring--it will make things easier to pull out once you have some separate pieces to start with.
David Newton wrote:For what it's worth, after some refactoring, I'm up to 11 methods, and am at the point where the abstraction/extension points are pretty clear, assuming we're generating our HTML in a servlet (not a great idea).
David Newton wrote:
By the way, having the connection and result set be instance variables is a really bad idea--servlets must be thread safe.
Farakh khan wrote:
Can you please explain it little bit more as to why I not instantiate them?
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Sam Mercs wrote:
Farakh khan wrote:
Can you please explain it little bit more as to why I not instantiate them?
Here is a good explanation -- http://www.javaworld.com/javaworld/jw-07-2004/jw-0712-threadsafe.html
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Sam Mercs wrote:True -- But before you actually make it re-usable the first thing do to would be Separate the View from the Model. Look up for MVC and JSP to get some idea. Once you have some of the view separated out from the code -- you'll see that it is pretty manageable...
Also look for paging in JSP -- you should find some code snippets that would help you ...
Sam Mercs wrote:True -- But before you actually make it re-usable the first thing do to would be Separate the View from the Model. Look up for MVC and JSP to get some idea. Once you have some of the view separated out from the code -- you'll see that it is pretty manageable...
Also look for paging in JSP -- you should find some code snippets that would help you ...