floater
Java Jedi
总版主
发贴: 3233
积分: 421
|
于 2003-09-12 05:31
More comments:
user-related: 1. Connection pool should be an interface, not a concrete class, so we could plug in other implementations, e.g., DataSource/JNDI lookup. 2. This implementation of Connection pool assumes we can create as many connections as we want - if none is available, creat a new one. So this is not in a production quality.
implementation-related 1. It would be better that SQLResults is also an interface, to shield out what users get and what package creator needs to populate; it would be easier to maintain it too, e.g., performance improvement later on, we just change the class, not the interface. 2. Transaction can be implemented in a seperate class to avoid complexity. 3. A better pool can be implemented using BoundedBuffer in Doug Lee's util.concurrent package. 4. Move all implementations to subdirectories could have a cleaner view of the src tree.
So overall, this one is really close except the connection pool.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." - Martin Fowler, Refactoring - Improving the Design of Existing Code
|