greenflute 发表于 2006-9-7 10:16

[Link]No ORM: The simplest solution?

TheServerSide.Com (TSS)


1. I needed a way to put all the SQL queries and DDL's in a separate file. This allows me or a DBA to later analyze the query with a fine tooth comb and optimize if necessary. It also allows me to easily change them without changing the code. Most of all cleanliness of the solution is appealing. At this point I am sure you are thinking of iBatis. I tried iBatis. Initially I liked it and thought I had my solution. However as I went down the lane I realized it too gave me features that I didn't need. Even this was more complicated than I needed. All I needed was a HashMap saved to a file in XML format. And my database class should support query execution by name (think key-value).

2. Secondly I needed connection pooling to prevent opening and closing too many connections and also running out of connections. I found a nice solution in Proxool. Additionally it supports having multiple connection profiles in a simple text file.

3. I needed to integrate these two capabilities in a simple database class along with utility methods like cleanly closing connection and logging the query data.


http://www.theserverside.com/common/printthread.tss?thread_id=41715
页: [1]
查看完整版本: [Link]No ORM: The simplest solution?