Changes for page WebObjects with Scala

Last modified by Ravi Mendis on 2011/05/10 02:10

From version 385.1
edited by Ravi Mendis
on 2009/12/15 18:11
Change comment: There is no comment for this version
To version 384.1
edited by Ravi Mendis
on 2009/12/08 18:58
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -157,26 +157,12 @@
157 157  
158 158  ==== Scala Annotations vs. Generic Accessors ====
159 159  
160 -An example of accessing variables in WebObjects with the following languages:
160 +An example of accessing variables in the following languages:
161 161  
162 -|= |= Objective-C |= Java |= Scala
163 -|= getter | ##object name## | ##object.name()## | ##object.name##
164 -|= setter | ##object setName:aName## | ##object.setName(aName)## | ##object.name = aName##
162 +|= |= Objective-C |= Java |= Scala
163 +|= getter | [[object name]] | object.getName() | object.name
164 +|= setter | [[object setName:aName]] | object.setName(aName) | object.name = aName
165 165  
166 -Of course in Java, we may generate WebObjects classes with "get" methods as well in order to stick to convention.
167 -In scala there is an additional convenience we may use to produce "get" and "set" methods in addition to the default Scala accessors - Scala Annotations.
168 -
169 -E.g, in Main.scala we annotate our component keys with ##@BeanProperty## to automatically create public "set" and "get" methods.
170 -These variables can then be accessed via //KVC//.
171 -
172 -{{code}}
173 -
174 -@BeanProperty var username = new String()
175 -@BeanProperty var password = new String()
176 -@BeanProperty var isAssistantCheckboxVisible = false
177 -
178 -{{/code}}
179 -
180 180  == How to Use Scala Collections with EOF ==
181 181  
182 182  One of the benefits of Scala is its very powerful, concurrency-ready collection classes - primarily ##List##, ##Map##, ##Seq## and ##Set##.
... ... @@ -230,10 +230,3 @@
230 230  1. Change the File Names Extension to "scala"
231 231  1. In Destination Paths set the Superclass Package (e.g: base)
232 232  1. Uncheck Java under Options
233 -
234 -== How to Build & Deploy a WebObjects Scala Project with Ant ==
235 -
236 -1. [[Download>>http://www.scala-lang.org/downloads]] and install Scala
237 -1. Set ##scala.home## (the location Scala has been installed onto) in the project ##build.properties## file
238 -1. Add the ##scalac## tasks to the ant build.xml file
239 -1. Customise the app classpath file. i.e either ##MacOSClasspath.txt## or ##UNIXClasspath.txt##. You will need to add an entry for ##scala-library.jar##