File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Laszlo Mihalka
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Laszlo Mihalka
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic