JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Software Design » J2EE DP  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 Re:Core J2EE Patterns - Transfer Object [Re:worookie]
im1000



版主

發文: 149
積分: 7
於 2003-10-07 14:27 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
worookie wrote:
我也是這一兩天才有多看一下 TO 的東西
有學到一樣很重要的
就是 TO 本身的 class 裡不該有商業邏輯 (business logic) 的 methods
應該就只有單純的資料內容
所以這幾天我就把我以前的 TO classes 裡的 business methods 拿掉
把他改放在 Session Facade 裡了
不知道這樣的做法對不對?

在 Facade 裡面, 也是不建議有所謂的商業邏輯存在的,
Session Facade 的定義其實只是個

Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.

我建議抽出 Business Logic into Business Object ,
不過一般情況, 我自己覺得有點畫蛇添足,

而 transaction 處理 ,
我就認為 commint / rollback 不該在 Facade 做
Facade 我認為應該是呼叫一個 BusinessTxSessionBean
BusinessTxSessionBean 裡, 利用各種 Entites 溝通得到結果 後回傳給 Facade
或者是, 可能有很多 if ... else , while , for 等等的條件判斷
在 Facade 中, 顯得有點多餘了 @@"


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
10079 [精華] Core J2EE Patterns - Transfer Object worookie 109 2003-09-11 02:20
8465 Re:Core J2EE Patterns - Transfer Object worookie 185 2003-09-15 01:28
8866 Re:Core J2EE Patterns - Transfer Object im1000 861 2003-10-07 14:27
8835 Re:Core J2EE Patterns - Transfer Object popcorny 819 2003-09-14 23:25
10446 Re:Core J2EE Patterns - Transfer Object ingramchen 1648 2003-09-15 17:49
8419 Re:Core J2EE Patterns - Transfer Object browser 25 2003-09-15 18:16
8602 Re:Core J2EE Patterns - Transfer Object popcorny 295 2003-09-15 18:18
8312 Re:Core J2EE Patterns - Transfer Object jini 281 2003-10-07 09:07
8349 Re:Core J2EE Patterns - Transfer Object ingramchen 501 2003-10-07 12:55
8492 Re:Core J2EE Patterns - Transfer Object im1000 779 2003-10-07 14:06
9338 Re:Core J2EE Patterns - Transfer Object ingramchen 1176 2003-10-07 18:11
8614 Re:Core J2EE Patterns - Transfer Object im1000 1174 2003-10-07 21:00
8320 Re:Core J2EE Patterns - Transfer Object ingramchen 886 2003-10-07 22:23
9045 Re:Core J2EE Patterns - Transfer Object im1000 1491 2003-10-07 23:27
9473 Re:Core J2EE Patterns - Transfer Object ingramchen 1913 2003-10-08 00:55
8239 Re:Core J2EE Patterns - Transfer Object worookie 12 2003-09-24 02:15
8406 Re:Core J2EE Patterns - Transfer Object weihuo 222 2003-10-07 08:37
» JWorld@TW »  Software Design » J2EE DP

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8