Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Framework to access Services from a Server...

 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently, the services will use Servlets. (through this Framework)..but, later, the Servlets would be replaced by web services. But, the Swing Client will use the Framework so that we do not need to change many classes. Framework will protect the client. Can someone suggest me such a framework?
 
Ajay Singh
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the business problem you are solving here?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the servlet return now - XML? Then you could argue that it is a service already. If not then you may want to standardize now on an URL scheme that you can use unchanged later when you switch to REST-style services, and on a response format you can use now and later (most likely XML or JSON).
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My servlets, return serialised objects. I am eager to know more on REST, can you provide my some good links on it.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The http://faq.javaranch.com/java/WebServicesFaq has an extensive section with good links regarding REST.

Serialized objects are a Java-only technology, which goes against the spirit of web services. If your objects are JavaBeans you could use java.beans.XMLEncoder/Decoder for serialization. That would give you a shot at cross-platform compatibility and might still be usable in a more WS-style architecture.
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh Great tip. So I should plan my servlets not to use serialised objects, and use JavaBeans instead?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The benefit is that if your objects can be represented as JavaBeans, then you get the (de)serialization for free. I'm not sure how well that works with more complicated objects (like nested arrays and collections), but it's easy to try and see what those classes create from those.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic