>>>是否可行?yes>>>有什么利弊?!you'd better write a Data Access layer to separate the concerns, the problems I can think of are:1. of course, more complexity, but also cleaner, and easy to change
2. extra files to maintain/deploy, and potentially can be tampered. Of course, you could also embed the text files in the resource assembly
3. consistency, extra testing
4. performance hit for initial loading, but you can cache the SQLs in Application or Cache variables
5. performance hit when you extract the right SQL for your current sql operation. You can cache each individual SQL statement separately, then again, more complexity
6. I suppose you are using OleDb classes, so you cannot utilize the optimized performance with SqlClient classes if you are using SQL Server
2. extra files to maintain/deploy, and potentially can be tampered. Of course, you could also embed the text files in the resource assembly
3. consistency, extra testing
4. performance hit for initial loading, but you can cache the SQLs in Application or Cache variables
5. performance hit when you extract the right SQL for your current sql operation. You can cache each individual SQL statement separately, then again, more complexity
6. I suppose you are using OleDb classes, so you cannot utilize the optimized performance with SqlClient classes if you are using SQL Server
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货