Summary
BEA's James Bayer recounts his experience using Scala with Eclipse and the BEA WebLogic server.
Advertisement
While Scala development tools tools are still lacking compared with their Java-focused cousins, such tools are gradually gaining both features and users. In a recent BEA dev2dev article, James Bayer presents a tutorial on the Eclipse Scala plug-in, and how to use Scala code in an enterprise Java application in conjunction with JSPs in Scala Development with Eclipse and Weblogic:
Bayer sums up his experience thus:
Scala actually is fairly easy to integrate into both tools and runtimes that most java developers will already be familiar with... I could have just as easily deployed this to Tomcat., or WebLogic Event Server...
The scalac compiler takes .scala files and builds .class files that have a dependency on the scala-library.jar... Therefore, the only thing you need to invoke and run them from java is to have the .class files and the scala-library.jar on your classpath... The converse is also true; Scala objects can just as easily invoke java objects by including them on the scala classpath...
Using Scala code within Eclipse is supported by the Eclipse Scala plugin, providing, for example, Scala syntax highlight:
In spite of such basic editing support, Bayer also notes some notable lacks in the current Eclipse Scala plug-in:
The developer experience is not quite ideal with respect to the packaging Scala artifacts to be used easily in Dynamic Web Projects for iterative development with WebLogic Server. First of all, I could not find a non-custom way of exporting the Scala .class files into a jar file...
After deciding not to spend more time on the packaging issues I moved on to another basic concept, simply calling a Scala object from a JSP. In this case there is a suitable example addressbook.scala on the Scala site that spits out an addressbook in Xhtml. This example also showcases one of the Scala languages handy features of native XML support...
What do you think of the current state and direction of Scala development tools?
Check out Groovy and Grails with Intellij IDEA simply rocks!.
I think the future is the dynamic languages, static typed languages yuk! Java will be my last one after Java I will go with dynamic ones Python, Groovy, Ruby so on. Of course on top of the JVM, the JVM it is a great piece of software. Anyway Java will be with us for a long time so I don't hurry to switch, Java still young and Groovy is looking sexy more. Scala could be great before in the 90's now is Dynamic languages times!.
I think Scala is a great language and there is a place for it -- statically typed, low noise, expressive language.
It's true that for Java people to start using Scala, Scala needs to have first class IDE support. I don't think anyone wants to code without code completion these days. I know I am wrong because obviously some people use Scala even today, but I think it's not a bad generalization.