Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Are there any good sites / blogs / books / articles on using Java EE together with Scala? Or indeed articles saying that it should not be done.

Many Scala resources talk about using Akka and Lift. Akka solves a different domain problem than Java EE. I don't know Lift, but I assume its geared towards the web end of Java EE and doesn't replace app server containers which provide transactions, security, scalability, resource management, reliability, etc. (all those things which Java EE markets itself as being good at).

share

closed as off-topic by maple_shaft Dec 25 '13 at 23:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – maple_shaft
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
possible duplicate of Is there a canonical book on Scala? –  Matthieu Jan 12 '12 at 21:08
1  
Write your Java EE code in Scala and compile them to class files. –  Chiron Jan 12 '12 at 21:16
    
Sure, I've done that. But is it that simple? Or are there catches? Are there things you shouldn't do? Does the average Scala programmer turn their nose away from Java EE in disgust? If so, why? Or is Scala simply an extra tool in the box which can happily be used together with Java EE containers? –  Ant Kutschera Jan 12 '12 at 21:19
1  
It's not a duplicate, because I am specifically asking in reference to Java EE. The other article doesn't mention Java EE. –  Ant Kutschera Jan 12 '12 at 21:20
    
@AntKutschera : Scala will almost always be related to Java. the first resource proposed, Programming in Scala, offers an entire chapter named "Combining Scala and Java". and second one, Scala In Depth , a chapter named "Integrating Scala with Java". –  Matthieu Jan 12 '12 at 22:18

1 Answer 1

I wouldn't mix Scala and Java in a project. Calling Scala code from Java is complex and way harder than the reverse. You'll probably waste your time to glue together the code. Although I think lift will get most of the work that you need done it's surely not as established as Java EE. It's a server side technology with heavy use of templates. Security and scalability are very good. As I've only played around with it out of curiosity I can't tell about resource management and transactions. Reliability is up to your code and your hosting provider.

About Scala + lift in general:

Using Scala after Java is like breathing fresh air. To speak a little heresy: In my opinion Scala + lift is easily as beautiful as Ruby + rails. You have native xml and therefore html support. Scala is the most complex but also the most elegant language I've ever written in and lift makes full use of Scala's potential.

Update:

here's an interesting quote for you "Lift applications are packaged as WAR files and can be deployed on any Servlet 2.4 engine (e.g., Tomcat 5.5.xx, Jetty 6.0, etc.) " it comes from here http://demo.liftweb.net/. Writing the code in Scala but using Java EE services is possible but at least in my opinion not a good choice. If you want to use Scala you should stick with its own technologies. Scala is far superior to Java and has syntax features Java frameworks can only dream of. Lift makes use of them. Moreover as you're meantoning transactions I guess your project will be commercial and at least medium sized. That makes Scala + Java EE a difficult choice. Many professional Java developers will have problems reading your code and therefore getting help will be troublesome.

share
    
With "reliability" I was referring to having a clustered environment. Java EE servers support that. Does Lift run as a WAR in a container, or as a standalone server? –  Ant Kutschera Jan 12 '12 at 22:17
    
What about writing everything in Scala, but using Java EE annotations and APIs and deploying the result to a Java EE container? Does that make sense? –  Ant Kutschera Jan 12 '12 at 22:17

This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .