Changes for page Development-WO Component-Code Template and WODs
Last modified by Pascal Robert on 2012/07/19 21:09
From version 11.1
edited by Pascal Robert
on 2007/09/03 17:06
on 2007/09/03 17:06
Change comment:
There is no comment for this version
To version 13.1
edited by David Avendasora
on 2011/05/03 04:46
on 2011/05/03 04:46
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Web Applications-Development-WO Component-Code Template and WODs1 +Development-WO Component-Code Template and WODs - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. probert1 +XWiki.avendasora - Content
-
... ... @@ -8,7 +8,7 @@ 8 8 9 9 === WODynamicElements === 10 10 11 -If you are building a [[WODynamicElement>>http:// developer.apple.com/documentation/WebObjects/Reference/API/com/webobjects/appserver/WODynamicElement.html]], your class will not have a Template or WOD file. Any output is generated in code directly. WODynamicElements also can not assume that there will be an instance per usage, rather a single instance of your class may be concurrently serving multiple Components. As a result, your WODynamicElement must be completely thread-safe. These attributes make WODynamicElements ideal for producing relatively small output or output that is "computed." If you find yourself writing large amounts of code to handle outputting data, you may want to consider the benefits of templates that come from building WOComponents.11 +If you are building a [[WODynamicElement>>http://webobjects.mdimension.com/javadoc/WebObjects/5.4.2/com/webobjects/appserver/WODynamicElement.html]], your class will not have a Template or WOD file. Any output is generated in code directly. WODynamicElements also can not assume that there will be an instance per usage, rather a single instance of your class may be concurrently serving multiple Components. As a result, your WODynamicElement must be completely thread-safe. These attributes make WODynamicElements ideal for producing relatively small output or output that is "computed." If you find yourself writing large amounts of code to handle outputting data, you may want to consider the benefits of templates that come from building WOComponents. 12 12 13 13 There are three primary methods that you may implement in your WODynamicElement depending on the type of interaction your element provides or requires: 14 14 ... ... @@ -32,7 +32,7 @@ 32 32 33 33 {{/code}} 34 34 35 -This same pattern is used for [[Stateless WOComponents>> Web Applications-Development-Stateless Components]]. WODynamicElement can provide a .api file to describe its bindings. For more information on .api files, see the .API File section below.35 +This same pattern is used for [[Stateless WOComponents>>Development-Stateless Components]]. WODynamicElement can provide a .api file to describe its bindings. For more information on .api files, see the .API File section below. 36 36 37 37 === WOComponents === 38 38 ... ... @@ -100,7 +100,7 @@ 100 100 101 101 {{/code}} 102 102 103 -which would bind the zipcode of the address of the person in your sesson to value. Even more interesting are the NSArray operations that Foundation provides. For instance, if your session had a ##public NSArray purchaseAmounts()## that returned an array of ##BigDecimal##s, you could refer to the binding ##value = session.purchaseAmounts.@sum##, which would return the sum of the values of the array. There are several other Array operations available in the Foundation classes, and Project Wonder provides even more in its [[ERXArrayUtilities>> Programming__WebObjects-WOnder-ERXArrayUtilities]] class. For even more advanced KVC capabilities, read the [[WOOgnl>>Programming__WebObjects-ProjectWONDER-Frameworks-WOOgnl]] section of Project Wonder.103 +which would bind the zipcode of the address of the person in your sesson to value. Even more interesting are the NSArray operations that Foundation provides. For instance, if your session had a ##public NSArray purchaseAmounts()## that returned an array of ##BigDecimal##s, you could refer to the binding ##value = session.purchaseAmounts.@sum##, which would return the sum of the values of the array. There are several other Array operations available in the Foundation classes, and Project Wonder provides even more in its [[ERXArrayUtilities>>WOnder-ERXArrayUtilities]] class. For even more advanced KVC capabilities, read the [[WOOgnl>>Project WONDER-Frameworks-WOOgnl]] section of Project Wonder. 104 104 105 105 A single WOD entry can contain several binding declarations, and a WOD file can contain many entries. For example, here is an excerpt from a real WOD file: 106 106