Skip to Content.
Sympa Menu

notify-dpml - r1916 - trunk/central/site/src/docs/metro/component/semantics

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1916 - trunk/central/site/src/docs/metro/component/semantics
  • Date: Sat, 17 Mar 2007 17:27:24 +0100

Author: mcconnell
Date: 2007-03-17 17:27:23 +0100 (Sat, 17 Mar 2007)
New Revision: 1916

Modified:
trunk/central/site/src/docs/metro/component/semantics/parts.xml
Log:
more on parts

Modified: trunk/central/site/src/docs/metro/component/semantics/parts.xml
===================================================================
--- trunk/central/site/src/docs/metro/component/semantics/parts.xml
2007-03-17 16:16:43 UTC (rev 1915)
+++ trunk/central/site/src/docs/metro/component/semantics/parts.xml
2007-03-17 16:27:23 UTC (rev 1916)
@@ -28,8 +28,65 @@
A <tt>Parts</tt> interface is recognized using either the default
inner class pattern, or via the assertion of part-semanitcs using the
parts annotation.
+ The following code fragment demonstrates a component that declares
+ its internal structure via an internal <tt>Parts</tt> inner interface
+ and the usage of that interface as a constructor parameter.
</p>

+<pre>
+public class Container
+{
+ <font color="darkred">public interface Parts
+ {
+ Widget getWidget();
+ Gizmo[] getGizmos();
+ }</font>
+
+ public Container( <font color="blue">final Parts parts</font> )
+ {
+ Widget widget = parts.getWidget();
+ Gizmo[] gizmos = parts.getGizmos();
+
+ ...
+
+ }
+
+ ...
+}
+</pre>
+
+ <subsection name="Parts Interface Semantics">
+
+ <p>
+ Semantics of the parts interface focus on the supply of
+ internal components to an enclosing component using either
+ of the following patterns:
+ </p>
+
+ <ul>
+ <li>Access to a sub-component by key where the the return type
+ is a single value and the key is determined in accordance with
+ JavaBean naming conventions. The method may declare at most
+ one parameter where the parameter type is a class
corresponding
+ to the desited return type.</li>
+ <li>access to a set of sub-components based on the type
+ of an array return type of the method</li>
+ </ul>
+
+ <p>
+ On instantiation Metro will supply a implementation of the parts
interface
+ wherin subsidiary parts will by default only be instantiated on
demand.
+ Furthermore, it is the responsibility of the enclosing component to
main
+ the appropriate hard, soft or weak refernce to the sub-component.
+ </p>
+
+ <p>
+ On termination of the enclosing component, all sub-component will be
+ be subject to implicit termination.
+ </p>
+
+ </subsection>
+
</section>

</body>




  • r1916 - trunk/central/site/src/docs/metro/component/semantics, mcconnell at BerliOS, 03/17/2007

Archive powered by MHonArc 2.6.24.

Top of Page