Java EE replaces Scala?

Many Java x Scala comparisons seem to focus only on languages (syntax, collection APIs, actors, etc.), but what about enterprise application development?

If you want to build a distributed enterprise system using Scala, do you use Scala syntax (such as EJB compatible classes using Scala syntax) to encode traditional Java EE applications and run them in the Java EE container, or do you replace the scala ecosystem with Java EE in the Java EE container?

If the second, the most recent thing I've found so far, is a type safe stack; Is Scala replacing the Java EE container?

Is akka JMS (possibly session bean), or does your Scala system still utilize Java EE services?

Solution

Okay,

=>JavaBeans: variable data structures are simple, not thread safe Putting them in a container won't change anything Use immutable data structures instead of using caseclasses to execute Scala

=>EJB: EJB is just sucking The real problem is that EJBs need to be cohesive to be useful in reusability, which is not the case Put them in a container to make it better In Scala, using idiosyncrasies, for composition, you can use ad-hoc composition using constructor injection protected by F bounded polymorphism Life can be so easy

=>Transaction mode: Yes, the transaction manager has made things better, but it still needs a large Java EE stack to make it work In Scala, you only need to use the software transaction memory (STM) provided by akka

=>Persistence: do we really need ORM? Like squeryl Org will add strongly typed LINQ. Org to scala Instead of the query language mapping as heavy as hibernate, it is only integrated to query Scala, which is completely checked by the compiler Of course, this is also true for relational databases There are other solutions available for no SQL

=>Zoom? Cluster Java EE? Do I need to talk more? In akka, you only need to add some servers to expand the system Why? Because remote actors are processed and accessed in the same way as local actors and all content, otherwise it's just a matter of configuring your distributed actor system Akka is based on Erlang mode, so they don't look for 59 uptime, but 99 uptime under the whole system load Meanwhile, akka is so light and easy to use on Android Will you try to run Java EE on Android? https://github.com/gseitz/DiningAkkaDroids

It should be clear that perhaps ten years ago, the answer to the question of how Java EE was built is large enterprise software. Once spring is available, it may be the best solution Today, great changes have taken place in the world, and most of the old answers do not accord with today's reality Scala, it's not perfect, but if it comes down to a line, it's like this:

In Scala, I finished my actual programming in a fraction of the time and the container settings will take up a lot of time

Even spring, as the framework of choice for Java EE, is moving towards Scala:

http://blog.springsource.org/2012/12/10/introducing-spring-scala/

From the beginning, akka's concepts and best practices have a convenience book called "akka essential"

http://www.akkaessentials.in/2012/12/adding-turbchargers-to-jee-apps.html

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>