Author: kylem
Date: Fri May  6 13:14:17 2005
New Revision: 168647

URL: http://svn.apache.org/viewcvs?rev=168647&view=rev
Log:
Added basic section and sample describing Control inheritance.

Modified:
    
incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/controls/controlsProgramming.xml

Modified: 
incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/controls/controlsProgramming.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/controls/controlsProgramming.xml?rev=168647&r1=168646&r2=168647&view=diff
==============================================================================
--- 
incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/controls/controlsProgramming.xml
 (original)
+++ 
incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/controls/controlsProgramming.xml
 Fri May  6 13:14:17 2005
@@ -905,6 +905,36 @@
 <p>Whether ContainerBeanContext or ControlBeanContext, the BeanContext 
instances also provide the basic hierarchy of composition, as shown by the 
parent-child relationships above.</p>
             </section>
         </section>
+        <section>
+            <title>Inheritance</title>
+            <p>The Controls architecture also makes it possible to extend the 
functionality of existing Controls using standard Java inheritance.   While 
more complex scenarios are possible, a common model for extending a Control 
type using inheritance involves extending both public interface <b>and</b> the 
implementation to extend base functionality by adding new operations, events, 
or properties.</p>
+<p>The following code sample shows the basic structure:</p>
+<p><strong>Basic Inheritance Sample Code</strong></p>
+<source>
+     // A.java: The base control interface
+     @ControlInterface
+     public interface A { ... }
+
+     // AImpl.java: The implementation of the base control interface
+     @ControlImplementation
+     public class AImpl implements A { ... }
+
+     // B.java: The extension of the base interface that adds 
+     // operations, properties, and/or events
+     @ControlInterface
+     public interface B extends A { ... }
+
+     // BImpl.java: The implementation of the extended control interface
+     @ControlImplementation
+     public class BImpl implements B { ... }
+</source>
+
+<p>In the example above, the BBean JavaBean class that results from processing 
of B.java will expose the operations, properties, and events defined by both 
the A and B control interfaces.  The BImpl class would need to implement all 
operations defined by the B interface, and could also choose to override some, 
all, or none of the operations defined by A.</p>
+
+<p>Inheritance is also supported for extensible control types.  If AImpl 
implements the Extensible interface, then BImpl could choose to define 
additional extensibility PropertySets and implement a new Extensible.invoke() 
method to provide their semantics (delegating to AImpl.invoke() as approriate). 
It could also choose not to extend the extensibilty semantics and allow all 
operations defined within a ControlExtension derived from B to be handled by 
AImpl.invoke().
+</p>
+
+        </section>
         
         <section>
             <title>Context and Resource Events</title>


Reply via email to