On 2010-07-30 21.31, Paul Merlin wrote:
Hey guys,
Just to keep you informed.
Stanislav and I are currently refactoring theses projects in order to use java-
sql-dsl for SQL generation : http://github.com/stazz/java-sql-dsl
So if you did not have time to look at the code yet, please wait until we're
done with the refactoring. It will be much easier to read then :)
I've just taken a quick peek, and have a few comments that you can keep
in mind during refactoring.
* We don't use "_" prefixes anywhere else in the code, so please refrain
from that.
* I see you make one connection and share it. That is not how
connections are supposed to be used. It would be much better if you
inject a DataSource (implemented by a connection pool) into the
EntityStore, and then retrieve/return connections on each JDBC call.
Otherwise concurrency and error handling becomes a nightmare.
* Consider not doing table management in the EntityStore. I'm using
LiquiBase in Streamflow for all table management, on an application
level, and it simplifies evolution a lot (which you can't handle in the
current setup). Let the EntityStore focus on one thing only.
* Does the entity table include a version column? In order to do proper
concurrency checking you pretty much have to, and then use it on UPDATE
calls.
* Don't replicate Activatable by doing startDatabase/stopDatabase. Just
let the service implement Activatable.
* What is the "PK" column for? Isn't it enough with the identity one?
* Please use SLF4J for logging instead of System.out.
Those were the things I could see from a quick look at it. The most
important is how you use connections, which right now isn't correct.
Keep up the good work! Really looking forward to seeing the end result
of it!
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev