• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

EJB Question.

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
First of all I'm going to describe the architecture I'm using.
I'm writting an application that uses an Oracle 9i Database, and Weblogic 6.1 sp1 as the Application Server. Also I use Entity CMP EJBs mapped to the database. In adittion I use Session EJBs as Facades of the Entity Beans. The presentation tier is implemented with JSP and Servlets (and perhaps XML).
1- When I have to return a "record set" to the client (in this case a JSP page) from the Facades I use a Collection containing Value Objects in place of a Collection containing Remote Interfaces to the Entity Beans. Is it a good solution in terms of performance?
2- It would be a good solution to return XML from the Facades in place of Collections?
3- Is there any API to generate XML from Collections?
Thanks in advance.
Cristian
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Cristian Cardenas:

3- Is there any API to generate XML from Collections?


I'm at a bit of a loss for most of your questions, but I do know that in the new version of Java, 1.4, there is an API for reading and writing XML. I don't think you can read/write directly from or to collections, but you could probably roll an API of your own to do so. Check out the DOM section of this link.
Corey
 
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For your questions 1 & 2, you might want to refer to this page: http://www.martinfowler.com/isa/dataTransferObject.html and see whether you are violating any of the guidelines for using this.
As for transferring using XML vs. Collections, the XML may be easier to serialize than the Collection (depends largely on what your collection contains). The only way to really tell which approach is better in terms of performance is to run some tests and get benchmarks. The XML approach may add some complexity to your code but you should weigh that against other factors.
Junilu
 
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cardenas,
.When I have to return a "record set" to the client (in this case a JSP page) from the Facades I use a Collection containing Value Objects in place of a Collection containing Remote Interfaces to the Entity Beans. Is it a good solution in terms of performance?
If the data which your jsp displays is not all that critical then its ok otherwise if it is a time specific data then this approach would result in user seeing the stale data and it won't work.
It would be a good solution to return XML from the Facades in place of Collections?
If the target audience for your jsp page is on a web-browser, a plam-top then returning a xml would be beneficial in this case than collection
Is there any API to generate XML from Collections?
You can check the JAXP package, but I doubt there is something which returns XML from collections
Rishi Singh
SCJP,SCWCD
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SOAP is for xml based messaging. This is most likely the API you'll want to use.
reply
    Bookmark Topic Watch Topic
  • New Topic