File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Getting Document in an Entity EJB via HTTP vs. Web Services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Getting Document in an Entity EJB via HTTP vs. Web Services " Watch "Getting Document in an Entity EJB via HTTP vs. Web Services " New topic
Author

Getting Document in an Entity EJB via HTTP vs. Web Services

Laszlo Mihalka
Greenhorn

Joined: Jul 22, 2006
Posts: 3
Dear developers and architects:

There is Entity Bean's persistenced via JDBC . Each of them has an attribute holding a document. This document can be accessed either via HTTP or Web Services (WS) on an other Application Server (AS) . There is some questions concerning architect:
1. Is it recommended / allowed to write the HTTP or WS client code within the EJB ? If not, what kind of design is recommended ?
2. If both AS's reside within an Intranet (DMZ), shoud be preferred the HTTP solution ?

I'm very thankful for any suggestion.

Warm regards,

Laszlo
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Well, I would definitely seperate the call to either Http or Web Service outside of the EJB. Keep the responsibilities in seperate classes. So make a single class for accessing each type, and a Facade in front of it so the EJB doesn't need to know which assessing way is occuring.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Laszlo Mihalka
Greenhorn

Joined: Jul 22, 2006
Posts: 3
Do you mean with facade + single class, that there is no need to use of EJB, it is suitable using the mentioned combination ?

Laszlo
[ July 23, 2006: Message edited by: Laszlo Mihalka ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

No I didn't mean that there was or wasn't a need for the EJB. I was saying that the sooner you get to Plain Old Java Objects the more extensible it will be and the least coupled.

If you need managed Transactions, Security, CMP then you need to use EJBs. I just think that EJBs are just an interface to the outside world, a Facade so to speak. There should be zero, no business logic in EJBs. The EJB will delegate that to POJOs.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Document in an Entity EJB via HTTP vs. Web Services
 
Similar Threads
Getting Document in an Entity EJB via HTTP vs. Web Services
FREE CERTIFICATION BETA: SCDJWS 5
Sample Questions for 288 - Need answers
Web services and J2EE
web service not available