Hi, folks:

While perusing the code generated by WSDL2Java (using the XMLBeans
constructor), I noticed that the skeleton interface for one of my services
was as follows. It seems very strange to me that the method throws an
exception of a type which is defined within an inner class of its subclass.
Is there some reason for this? It seems contrary to one of the basic
principles of Object-Oriented Design, namely that a subclass should know
about and be able to reference its superclass(es), but not vice versa. (A
lot of undesirable results follow from breaking this rule, such as the fact
that if a superclass knows about specific subclasses, it becomes impossible
for someone to create new subclasses that work equivalently, and also
impossible to test subclasses independently, or to test the base class
independently). In fact, there seems little benefit to having an
"interface/implementation class" split if the interface is going to
reference the implementation class anyway.

I can't think of any reason why this would be desirable... if that specific
exception type is really part of the contract of the service, it should be
declared as an inner class of the interface, I think, not of the
implementation class. (The implementation class could then throw a subclass
of the class declared in the interface, if necessary).

Also, why is the exception an inner class at all? Why not just a standalone
class? That would remove this issue completely.

I'm wondering if I should file a JIRA bug for this issue.

Thanks for any information.

Derek


    /**
     * FEUServiceSkeletonInterface.java
     *
     * This file was auto-generated from WSDL
     * by the Apache Axis2 version: SNAPSHOT Jun 21, 2006 (10:23:14
GMT+00:00)
     */
    package crc.feuimport.wsdl2java;
    /**
     *  FEUServiceSkeletonInterface java skeleton interface for the
axisService
     */
    public interface FEUServiceSkeletonInterface {
     
                 
        /**
         * Auto generated method signature
         
          * @param param0
         
         */
        public  com.crc_corp.www.wsdl._2004_10_01.cars.ReturnDocument
acceptFEURecap
 
(com.crc_corp.www.schemas._2006_06_21.feuimport.RecapDocument param0 )
         
           throws
crc.feuimport.wsdl2java.FEUServiceSkeleton.FailureException;
     
    }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to