0 Replies Latest reply on Mar 23, 2006 2:46 AM by Chris Laprun

    WSDL-generated classes and good Java citizenship

    Chris Laprun Master

      Most of the business classes for WSRP are issued from WSDL-generated classes via JWSDP's wscompile. However, these classes are not necessarily really good Java citizens: they don't override equals or hashCode. They also are not using Java's collections rendering them rather inconvenient to manipulate.
      We have several options to deal with these problems:
      1. Promote these classes to first class citizens by re-implementing/improving them.
      Pros:
      - easier to deal with
      Cons:
      - if we need to re-generate these classes for some reason, we'll lose the work done

      2. Wrap them in our own classes.
      Pros:
      - protected from re-generation problem
      Cons:
      - WSRP interfaces use generated types so that's what we'll get requiring manual wrapping to deal with the instances in our code

      Right now, solution 1 seems really attractive since it is not anticipated that we would need to re-generate the classes at some point (at least, not until WSRP 2.0). Is there a major drawback that I am missing that would prevent us from implementing this solution?