Changes for page WebObjects with Scala

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

From version 452.1
edited by Ravi Mendis
on 2010/12/23 07:08
Change comment: There is no comment for this version
To version 453.1
edited by Ravi Mendis
on 2010/12/23 06:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,11 +1,14 @@
1 1  === What is Scala? ===
2 2  
3 -[[Scala>>http://en.wikipedia.org/wiki/Scala_(programming_language)]] is a JVM language that is a hybrid of Object-Oriented and Functional styles. Its [[functional language>>http://en.wikipedia.org/wiki/Functional_programming]] foundations and built-in Actors library makes it especially attractive for concurrent computing. In this day and age of multi-core processors concurrent computing can not be ignored.
3 +[[Scala>>http://en.wikipedia.org/wiki/Scala_(programming_language)]] is a JVM language that is a hybrid of Object-Oriented and Functional styles. It is useful as complete general purpose replacement for Java. But its built-in Actors library makes it especially attractive for concurrent computing. In this day and age of multi-core processors, concurrent computing can't be ignored.
4 4  
5 -Many of Scala's features have been designed with concurrency in mind, some of which may not be unfamiliar to Objective-C or WebObjects developers. Here's a summary:
5 +Many of Scala's features have been designed with concurrency in mind, primarily a preference for immutability and the use of other functional language paradigms.
6 +Some of these may not be unfamiliar to Objective-C or WebObjects developers.
6 6  
8 +Here's a quick summary:
9 +
7 7  |= |= Objective-C |= Java |= Scala
8 -|= Immutability | Collections //e.g: NSArray/NSMutableArray// | No | Yes
11 +|= Separation of Mutable & Immuable Datatypes | Collections //e.g: NSArray/NSMutableArray// | No | Yes
9 9  |= Closures | Blocks (//Extension//) | No | Anonymous Functions
10 10  |= Static variables | Yes | Yes | No
11 11  |= Static methods or functions | Yes | Yes | No
... ... @@ -30,10 +30,8 @@
30 30  Yes. It is very simple.
31 31  Scala compiles to java bytecode. Hence using it with WebObjects is fairly straightforward.
32 32  
33 -===== Caveats =====
36 +However, tool support is a weak point. You should use Eclipse 3.6 with bundle-less WO builds.  If your Application class is in Scala then you will have to create an Eclipse launch configuration manually. One weird thing is that once you add the Scala nature to a WO project WOD completion will stop working - this is unfortunate. Also the [[Scala plugin>>http://www.scala-ide.org]] is rather slow and still very buggy.
34 34  
35 -Tool support is a weak point. You should use Eclipse 3.6 with bundle-less WO builds.  If your Application class is in Scala then you will have to create an Eclipse launch configuration manually. One weird thing is that once you add the Scala nature to a WO project WOD completion will stop working - this is unfortunate. Also the [[Scala plugin>>http://www.scala-ide.org]] is rather slow and still very buggy.
36 -
37 37  = WebObjects In Scala =
38 38  
39 39  The following highlights some of the differences between Java and Scala in WebObjects: