java 6 web services share domain specific classes between server and client

Posted by user173446 on Stack Overflow See other posts from Stack Overflow or by user173446
Published on 2009-09-15T00:35:14Z Indexed on 2010/05/28 14:02 UTC
Read the original article Hit count: 279

Filed under:
|
|
|

Hi all,

Context:
Considering below defined Engine class being parameter of some webservice method. As we have both server and client in java we may have some benefits (???) in sharing Engine class between server and client ( i.e we may put in a common jar file to be added to both client and server classpath )

Some benefits would be :

  1. we keep specific operations like 'brushEngine' in same place
  2. build is faster as we do not need in our case to generate java code for client classes but to use them from the server build)
  3. if we later change server implementation for 'brushEngine' this is reflected automatically in client .

Questions:

  • How to share below detailed Engine class using java 6 tools ( i.e wsimport , wsgen etc )?
  • Is there other tools for java that can achieve this sharing ?
  • Is sharing a case that java 6 web services support is missing ?
  • Can this case be reduced to other web service usage patterns?

Thanks.

Code:


public class Engine {

   private String engineData;

   public String getData(){
        return data;
   }

   public setData(String value){
        this.data = value;
   } 

   public void brushEngine(){
        engineData = "BrushedEngine"+engineData; 

   } 

}

© Stack Overflow or respective owner

Related posts about java

Related posts about webservice