Changes for page WebObjects with Scala
Last modified by Ravi Mendis on 2011/05/10 02:10
From version 349.1
edited by Ravi Mendis
on 2009/10/12 21:31
on 2009/10/12 21:31
Change comment:
There is no comment for this version
To version 351.1
edited by Ravi Mendis
on 2009/10/13 02:09
on 2009/10/13 02:09
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -153,6 +153,25 @@ 153 153 154 154 {{/code}} 155 155 156 +== How to Use Scala Collections with WebObjects == 157 + 158 +One of the benefits of Scala is its very powerful, concurrency-ready collection classes - primarily ##List##, ##Map##, ##Seq## and ##Set##. 159 +Employing these instead of ##NSArray## and ##NSDictionary## in WebObjects/EOF may be challenging. 160 + 161 +But one may modify the EO templates to produce API such as: 162 + 163 +{{code}} 164 + 165 +def movies: NSArray[EOGenericRecord] = { 166 + storedValueForKey(_Studio.Keys.MOVIES).asInstanceOf[NSArray[EOGenericRecord]] 167 +} 168 + 169 +def moviesList: List[EOGenericRecord] = { 170 + movies.objects.toList 171 +} 172 + 173 +{{/code}} 174 + 156 156 == How to Add Scala to a WO Project == 157 157 158 158 {{include value="WOL:Adding Scala Support to a WOLips Project"}}{{/include}}