This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Shall I Use EJB or Java Interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Shall I Use EJB or Java Interfaces" Watch "Shall I Use EJB or Java Interfaces" New topic
Author

Shall I Use EJB or Java Interfaces

kishore routhu
Greenhorn

Joined: Jan 17, 2013
Posts: 14
We are working for a project which is developed using Servlets,
Stateless EJB and Hibernate. Basic HTTPServlet will receive request
data from client and it delegates processing job to respective
stateless EJB. The request message is an XML string(some times size >
5 KB). DAO layer using Hibernate will take care of accessing database.
There are some handler, utility classes which have calls from EJBs.
According to our business logic, No need of maintaining transactions
and security at EJB layer. Application is running in Jboss App server.
We are using mysql data source manged by Jboss and accessing from
Hibernate DAO layer

My Question is: In this case, Should I use Stateless EJB or Shall I go
with normal java interfaces ?
What is the necessity of EJB layer here ?
Viktor Pergjoka
Greenhorn

Joined: Aug 30, 2010
Posts: 20
Why don't you go with interfaces and when you think they fit better as EJBs you can transform them to EJB(vers 3+) with no so much effort.
VenuGopal Thati
Greenhorn

Joined: Feb 05, 2010
Posts: 4
Other option would be directly use EJB3, You will not have to spend lot of time on coding. If you have to use transactions and security in future there will not be any need to refactor your code.
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

I do not understand your desing. You have wtitten that you do not need any transactions. So you have thread local Hibernate sessions that are not associated with JPA transactions?


SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
 
Consider Paul's rocket mass heater.
 
subject: Shall I Use EJB or Java Interfaces
 
Similar Threads
Question about transactional attribute and session beans....
Project Architeture
now without EJB
Design issue (POJO and DTO/VO)
Confusion between Entity and Session Bean