Wiki source code of WebObjects with Scala
Version 293.1 by Ravi Mendis on 2009/09/15 19:36
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
21.1 | 1 | === What is Scala? === |
| |
195.1 | 2 | |
| 3 | Scala is a modern language not unlike Groovy. | ||
| |
209.1 | 4 | It is said to be more powerful (and faster) than Groovy or Rails which has been the reason for its adoption at sites like Twitter. |
| |
195.1 | 5 | |
| 6 | === Why Use Scala? === | ||
| 7 | |||
| |
284.1 | 8 | In a Web 2.0, building concurrent WebObjects applications is a must. |
| |
195.1 | 9 | Developing and maintaining a concurrent or multi-threaded WebObjects application can be challenging. |
| 10 | |||
| |
263.1 | 11 | Scala offers concurrency built into the language. |
| |
284.1 | 12 | So it may offer new solutions to WO developers... |
| |
195.1 | 13 | |
| |
247.1 | 14 | === Can WebObjects be Programmed With Scala? === |
| |
195.1 | 15 | |
| |
288.1 | 16 | Yes. It is very simple. |
| 17 | Scala compiles to java bytecode. Hence using it with WebObjects is fairly straightforward. | ||
| |
195.1 | 18 | |
| |
286.1 | 19 | == How to Develop WebObjects With Scala == |
| |
195.1 | 20 | |
| |
231.1 | 21 | 1. [[Install the Scala eclipse IDE>>http://www.scala-lang.org/node/94]] |
| |
286.1 | 22 | 1. Add Scala support to your project |
| 23 | 11. Right-click your project in the WO Explorer | ||
| |
288.1 | 24 | 11. In the context menu select Scala -> Add Scala Nature |
| 25 | 1. Convert or use ##.scala## instead of ##.java## source | ||
| |
195.1 | 26 | |
| 27 | {{note title="Note"}} | ||
| 28 | |||
| |
263.1 | 29 | This is for Eclipse/WOLips developers |
| |
195.1 | 30 | |
| 31 | {{/note}} | ||
| |
290.1 | 32 | |
| 33 | == WO Scala Example == | ||
| 34 | |||
| |
292.1 | 35 | The following is a mixed Java/Scala version of the WO Movies D2W app. |
| 36 | All the EO logic and WO components are in Scala. | ||
| 37 | Only the Application class is Java. | ||
| 38 | |||
| |
290.1 | 39 | {{attachments patterns=".*zip"}}{{/attachments}} |