• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DAO to access to web service?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I access to a web service using JAX-RPC from a SLSB, should i use a DAO to access to the web service? What do you think?

Thanks in advance.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the pros and cons ?
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A DAO is supposed to retrieve data and pass around value objects. A DAO implies that a user is working with a persistence. Does the web service have persistence ? If the persistence of the web service changes, how will you handle that ? How do you handle transactions ? Did you think about all these questions ?
 
Víctor García
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The web service don't have persistence, with the web service the application communicate with an external system. I don't manage transactions with the web service, because i think that there isn't a really standar tecnology to work with transactions in web service, is this correct?

My doubt is that the dao is to decouple the tecnology and code for communication with a system from services, but i think that using Jax-Rpc the service only have to call to an interface and therefore i don't need a dao, what doy you think about this?

Thanks for your answers, and sorry for my english.
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can read up on WS transactions -> http://www.ibm.com/developerworks/library/specification/ws-tx/

You will have to have a pretty strong technical reason to use a DAO to back a web service. I cannot think of one
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've used a Stateless bean functioning according to Proxy pattern to hide connection establishment and other ws-related stuff
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dmitri Ericsson wrote:I've used a Stateless bean functioning according to Proxy pattern to hide connection establishment and other ws-related stuff



You mean the SLSB acts as a proxy for the WS ?
 
Dmitri Ericsson
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, right. I've asked a question here about what pattern needs to be used, and proxy was an answer. I've got P overall, but I cannot state that this is the best solution
 
Víctor García
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answers...

I like the proxy pattern, i think that is better than dao to call a web service...

Dmitri, have you used WS transactions?

 
Dmitri Ericsson
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No I haven't, but in technical risks I've mentioned data integrity and suggested that they may be used if needed. WS transactions is quite a new topic for me, so I didn't go into details.
 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Víctor García wrote:
The web service don't have persistence, with the web service the application communicate with an external system. I don't manage transactions with the web service, because i think that there isn't a really standar tecnology to work with transactions in web service, is this correct?

My doubt is that the dao is to decouple the tecnology and code for communication with a system from services, but i think that using Jax-Rpc the service only have to call to an interface and therefore i don't need a dao, what doy you think about this?

Thanks for your answers, and sorry for my english.



Looks like this is a service layer to me, because you are using an external service. I would think interms of service layer pattern. Like somebody mentioned here, proxy will be a good choice.
 
Víctor García
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ok, thanks to all!!

In the next two weeks i submit the assignment and i will see if the proxy is a good choice

 
Víctor García
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have another doubt... i think that a proxy object will be in the integration tier... but to have a SLSB in the integration tier is correct?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
For me it looks a good case for the Business Delegate pattern. I quote : "The Business Delegate acts as a client-side business abstraction; it provides an abstraction for, and thus hides, the implementation of the business services. Using a Business Delegate reduces the coupling between presentation-tier clients and the system's business services." (http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html)

cheers,
MVC
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic