-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: What layer I put the transactions statments?
PostPosted: Wed May 25, 2005 8:40 am 
Newbie

Joined: Wed May 25, 2005 8:11 am
Posts: 9
Hi masters


It's a conceptual approach.. Where I put the transaction statments of NHibernate (begin,commit,rollback), in the DAO layer or GUI layer?

I saw programmers using the statments in the DAO, others in GUI... Where is the best place to put this :cry: ..

I always used it in GUI layer...


Best Regards
Leandro
Brazil :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 3:40 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 2:48 pm
Posts: 47
I use a separate object which starts, commits and rollbacks transactions. This object is part of a class library which is part of my solution. My domain classes also reside in this class library, it's not part of my GUI. My actual project references this class library.
So make a new class library to put your domain objects and helper classes in. It depends on which level of separation you want, but I would choose the way I described above.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 4:32 pm 
Newbie

Joined: Wed May 25, 2005 8:11 am
Posts: 9
JackBigMac wrote:
I use a separate object which starts, commits and rollbacks transactions. This object is part of a class library which is part of my solution. My domain classes also reside in this class library, it's not part of my GUI. My actual project references this class library.
So make a new class library to put your domain objects and helper classes in. It depends on which level of separation you want, but I would choose the way I described above.



So, based in your explanation, by example:

-GUI
-DAO / TRANSACTIONS
-B.O. (domain)

or this approach:
-GUI
-TRANSACTIONS
-DAO
-B.O. (domain)


What approach do you use?


Best Regards...


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 8:59 pm 
Regular
Regular

Joined: Mon May 16, 2005 1:35 am
Posts: 67
I am more inclined to use a "Service Facade" design pattern to act as a boundary between the UI and domain objects. The service layer is a good point to provide security, logging and transaction control.

So I would suggest:
- UI
- Service Layer
- Domain

This approach enables you to encapsulate your workflow/orchestration business logic in another layer outside the UI, which is useful if you need to access your logic from more than one front end (such as multiple UIs or Web Services for example). The service layer can be reused between each front-end.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 1:25 am 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
Personally, I subsribe to baggins' point of view. But I can see, and often agree, with points for placing the transactions in the DAO layer. But, besides these philosophical differences, each agrees that you should NOT place NH transactions in your UI layer. The UI layer really should have no knowledge of the perisistence layer.

imho, of course.

-devon


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.