Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: valuetype generators





dan kuwachi wrote:
Here is a sample...:

module Bank {
     valuetype EmployeePK{
        public string ssn;
    };
};


This is the impl in java you need to generate: public class EmployeePKImpl { EmployeePKImpl(); }




This is the default factory file you have to edit:


public class EmployeePKDefaultFactory implements
org.omg.CORBA.portable.ValueFactory {
  public java.io.Serializable read_value
(org.omg.CORBA_2_3.portable.InputStream is) {


// INSTANTIATE IMPLEMENTATION CLASS ON THE LINE BELOW: java.io.Serializable val = new EmployeePKImpl; <-- changed this line

    //throw new org.omg.CORBA.NO_IMPLEMENT(); <-- commented this line
    return is.read_value(val);   <-- uncommented this line
  }

}

Why do you want to do this? Why don't you use subclassing to redefine these in your own class? IMO, that is better from a style as well as maintenance. It looks like that is the intent of the generated factory class in any case.


Sreeni.




<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.