Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Architecture & Framework  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题被移动
该话题已被移动 - floater , 2004-06-16 01:58
如果您尚不清楚该话题被移动的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 Re:J2EE交流贴 [Re:Jove]
hitaco





发贴: 432
积分: 31
于 2004-06-16 23:17 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
page 4, User-->VO
I guess in some situations User may represent Business object/Domain object, for example, in hibernate architecheture, object can be detached, we do not need VO just holding data for business object.

page 6: ResultSet/Paging/ResultSet::absolute()
Some JDBC driver will not skip the data.
Suppose we have 10000 records in the query result and we are interested only in the 9999th row.
rs.abolute(9999) is not good concerning the performance, it will not be more efficient than looping the resultset from the very begining, which will cost much more time than rownum approach. (BTW: I have tested this in oracle driver)

page 9: query by inner class, anonymous inner class are good when used as strategy objects, but most developers will be confused with the syntax,
my opinion about inner class is: do not put too much code in the inner class, in some situations, we can create a helper method which will be invoked from the inner class.

String[] getAllUsername() {
final ArrayList list = new ArrayList();

return (String[]) jdbcTemplate.query("select name from user", new RowCallbackHandler() {
  public void processRow(ResultSet rs) throws SQLException {
   list.add(rs.getString("name"));
  }
})

return ......
}

about RuntimeException/Checked Exception:
I have seem many applications just try/Catch SQLException in DAO and wrap as app-specific exception, rethrown it, and let session bean layer to catch it and call SessionContext::setRollbackOnly(), it's not good, I prefer touse RuntimeException and let EJB Container automatically rollback the transaction, BTW, I do not know how hibernate deal with transaction when RuntimeException occurs.




话题树型展开
人气 标题 作者 字数 发贴时间
25017 [精华] J2EE交流贴 Jove 129 2004-06-15 16:11
21283 Re:J2EE交流贴 jfml 15 2004-06-15 16:16
21148 Re:J2EE交流贴 floater 3646 2004-06-16 22:39
21146 Re:J2EE交流贴 hitaco 1731 2004-06-16 23:17
21275 Re:J2EE交流贴 jigsaw 573 2004-06-17 09:36
21142 Re:J2EE交流贴 hitaco 1161 2004-06-17 10:13
21202 Re:J2EE交流贴 jigsaw 335 2004-06-17 09:44
21203 Re:J2EE交流贴 floater 322 2004-06-17 10:00
21195 Re:J2EE交流贴 floater 69 2004-06-17 10:13
21187 Re:J2EE交流贴 chenyajun5 21 2004-06-17 11:16
21172 Re:J2EE交流贴 zyzhang 1828 2004-06-17 22:04
21153 Re:J2EE交流贴 floater 460 2004-06-18 09:22
21249 Re:J2EE交流贴 Jove 617 2004-06-18 10:24
21093 Re:J2EE交流贴 floater 1158 2004-06-18 13:50
21152 Re:J2EE交流贴 Jove 308 2004-06-18 14:48
21225 Re:J2EE交流贴 nothing 4 2004-06-15 16:34
21100 Re:J2EE交流贴 floater 431 2004-06-18 21:32
20997 Re:J2EE交流贴 zyzhang 3887 2004-06-22 01:48
22619 Re:J2EE交流贴 zhbk 10 2004-07-30 14:58
21059 Re:J2EE交流贴 winconcom 23 2004-09-09 11:45
21434 Re:J2EE交流贴 jigsaw 55 2004-06-15 16:57
21376 Re:J2EE交流贴 wes109 0 2004-06-15 17:21
21326 Re:J2EE交流贴 wes109 25 2004-06-15 17:34
21325 Re:J2EE交流贴 zyzhang 412 2004-06-15 18:14
21982 Re:J2EE交流贴 floater 3201 2004-06-16 03:05
21220 Re:J2EE交流贴 jigsaw 4037 2004-06-16 13:45
21094 Re:J2EE交流贴 zyzhang 5937 2004-06-16 19:44
21303 Re:J2EE交流贴 Jove 357 2004-06-16 14:31
21220 Re:J2EE交流贴 Jove 136 2004-06-17 10:04
21241 Re:J2EE交流贴(2nd rar) Jove 58 2004-06-17 10:06

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923