Progress
Open Client
Developer’s Guide
Extending Proxy Objects
For the Java client, ProxyGen actually generates two class files for each object. One contains the implementation and the other is a delegating class that just calls this implementation class. The java-client code accesses the delegating classes. The delegating classes are created so that the Java client is not exposed to implementation details of the proxy. These delegating class are available for inheritance in Java while the implementation classes are final and cannot be extended.
CAUTION: Direct editing of any delegating class generated by ProxyGen is not supported. To modify a delegating class, you must extend (subclass) it.For example, if we have an
Account
AppObject and aTax
SubAppObject, ProxyGen generates the implementation classesAccountImpl.java
andTaxImpl.java
as well as the delegating classesAccount.java
andTax.java
. A skeleton of what the delegating classAccount
looks like can be found in Example 5–6.
Example 5–6: Delegating ClassesNote the
protected
member variablem_accountImpl
. If a SubAppObject or a ProcObject is created, this variable must be passed to its constructor. Example 5–7 shows what the constructor in theTax
class looks like.
Example 5–7: SubAppObject/ProcObject ConstructorsThe member variables are
protected
rather thanprivate
to allow a Java client to extend these classes. Example 5–8 shows how a client might extend theAccount
class as well as theTax
class.NOTE: To extend a SubAppObject or ProcObject, you must also extend the associated AppObject.
Example 5–8: Class Extensions
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |