• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing "read-only" web service best practices.

 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
I was just wondering if there were some simple guidelines to access a WEB service in my app. Should it sit in DAO like classe, just like th other DAOs that access relational DBs? How can I have a pool of sucha objects for better performance .. It will be mainly for reading operations..Maps from MapPoint..
Any help will be appreciated
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The DAO thing sounds good. From the application's point of view, you're just accessing yet another data source.
However, object pooling might not help with performance in this particular case. What would your MapPoint client code look like? Are the methods synchronized? Are you changing instance variables or just reading them? In the name of simplicity, I would start out without a pool and simply create a new "MapPoint client object" every time. Then, if the request takes your response time beyond what's acceptable, run a profiler and see where the time gets spent and tweak there. Object pooling helps in cases where creating the object is a resource intensive task. I'm not so sure whether yours suits this profile...
 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Lasse, Mange tak,
Well, the functions are read only, and blocking sync. calls... The pool was just to save object creation time as you mentioned, my app will easily support 1000 trans./ min, but the problem is MapPoint.. although they say in their SLA u can be assured a method invocation will not tke more then a sec-- It takes anything between 1-15 seconds to get a reply.. which makes my app look slow ... But you are right, I should take a look at the profiler... although each time I see all these 1000s of object creations for a simple app.. I get heart problems.. especially I am more the real-time c kinda guy..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!