-->
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.  [ 4 posts ] 
Author Message
 Post subject: JBoss/Hibernate-Architektur
PostPosted: Fri Apr 09, 2004 10:48 am 
Newbie

Joined: Fri Apr 09, 2004 10:42 am
Posts: 3
Hi,
is their any documentation about a 'clean' software-architektur using JBoss and Hibernate available. I've made my first experiences with that combintation. My feeling is, that their are too much mixes between business-logic and technical issues. I want to seperate my business-classes from my technical-classes (transaction, persistens). Any idea?

Thnx and best regards
CK


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 09, 2004 11:32 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
I layer in JBoss/Hibernate this way:

* Service method/transaction: a business level unit of work. It does Hibernate operations - HQL, saveOrUpdate etc. The Service method is given a Hibernate session to deal with (can use ThreadLocal here)

* Stateless Session Bean method: calls Service method/transaction - sometimes more than one. Manages Hibernate sessions.

Having the Service method means that you can test outside of JBoss with a test harness that sets up a session.

Our HQL use is pretty limited - at the same level as EQL with CMP. You can put a bunch of this in the mapping files if you want to.

How do you want to layer things?


Sherman


Top
 Profile  
 
 Post subject: Re: JBoss/Hibernate-Architektur
PostPosted: Sat Apr 10, 2004 3:25 am 
Regular
Regular

Joined: Wed Mar 03, 2004 9:38 am
Posts: 70
CosmoKiller wrote:
My feeling is, that their are too much mixes between business-logic and technical issues. I want to seperate my business-classes from my technical-classes (transaction, persistens). Any idea?


This is one of the reasons for the interest in lightweight containers such as spring. Spring has a very neat architecture: The combination of IoC "wiring" of your objects and using AOP interceptors for transaction management etc. keeps the actual logic of the application very clean.

Keeping persistence logic out of the main code of the application can be done by using separate data access objects (DAO). Incidentally, spring has very nice support for writing Hibernate DAO classes.

As for how to layer your code, check this thread:
http://forum.hibernate.org/viewtopic.php?t=929173&highlight=


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 11, 2004 4:41 am 
Newbie

Joined: Fri Apr 09, 2004 10:42 am
Posts: 3
Thnx, for your ideas.

My architektur-idea is:

UI Layer: presentation

UseCase Layer:
Here i want to implement my business logic. I want to use stateless session beans to get transactional safeness. But i want to seperate the bean classes from my usecase-implementation-classes to seperate technic and logic. I don't want to see any ejb-code/exceptions in my business-implementation. At the moment i don't have a concrete idea how to handle.

Database Layer:
Here i want to implement the persistent data objects. Should consists of two "layers", one which encapsulates the O/R-Mapping (I want to modell my object-modell with a case-tool, and than automatically generate the sourec-code, xdoclet), and one to implement object-business-logic, again without mixing technical and business classes. Also no concrete idea how to design it.

What do you think about it? Is any documentation/example/tutorial for an equal or nearly equal architektur available?

Thnx
CK


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.