

Guardian.co.uk Switching from Java to Scala - DanielRibeiro
http://www.infoq.com/articles/guardian_scala

======
hello_moto
Not to knock the wind out of Scala but most of his concerns have been answered
in Java EE 6. But then of course Java EE 6 is a little bit new, so he might
not know a bunch of stuffs earlier.

Some of the example: regarding their Content API returning JSON/XML, this can
be handled by JAX-RS easily. JAX-RS also provides more than JSON and XML (it
provides ATOM-XML as well which probably more suitable for better RESTful
services).

Spring MVC (the latest version, 3.0) also moving toward Rails-like
ActionController.

Both Spring MVC Controller and JAX-RS POJO methods can be annotated to handle
routing. As a results: way less XMLs.

JAX-WS 2.0 (pure WebService) is also way easier to create, implement, deploy,
and unit-test.

JPA 2.0 probably requires way less XML than Hibernate. You can also use JPA
2.0 with GlassFish and wrap your service (a.k.a EJB 3.1 lite) with
Transactional automagically with no extra XML file.

Newer Java APIs/libraries are also exploiting fluent-API practices to make it
more DSL-ish (as Martin Fowler decided to move to DSL after his OOP honeymoon,
so do his followers).

Don't get me wrong: Java is still verbose. But it's getting a lot way lighter
and simpler for web-app development (enterprise or not).

The biggest elephant in the room is the manager types and the old-school Java
developers that have had tons of experience with Struts or older frameworks
and wouldn't want to change their mindset.

------
andrewnez
The guardian are also moving towards using mongo instead of oracle, there was
an interesting talk by Graham Tackley from the guardian about their stack at
the recent mongoUK conference in London:
[http://skillsmatter.com/podcast/nosql/mongodb-at-the-
guardia...](http://skillsmatter.com/podcast/nosql/mongodb-at-the-guardian)

------
Tycho
If you look SE Radio (Software Engineering Radio) on iTunes podcast, or their
own website, there's an episode where they interview the Guardian website
developers (it is an award-winning website after all, gets a monstrous number
of hits).

~~~
JonnieCache
284,636,373 pageviews

33,371,947 uniques

per month according to <http://www.guardian.co.uk/advertising/jobs-audience-
network>

------
msluyter
The company I work for uses a Tomcat/Struts/Oracle stack, and I'd love to find
something less painful to use, but which is still java based (moving to a
different language here would probably meet too much institutional
resistance.)

The article mentioned the Play framework. Anyone have any experience with it?

~~~
hello_moto
It depends on how old-school your company is.

Play Framework, while it is still using Java, breaks the old-tradition of
getter/setter. Your peers might resist instantly when they saw that part.

If Play Framework is too extreme for your workplace, I'd suggest to give
Spring MVC 3.0 or use the latest Java Servlet 3.0 in JEE6.

Java Servlet 3.0 supports annotations
(<http://blogs.sun.com/swchan/entry/servlet_3_0_annotations>) that provides
routing capability (might not be as powerful as Rails routing, but still
something new and nice to try).

For ORM, either JPA 2.0 (recommended) or Hibernate (Hibernate specific APIs,
not Hibernate as JPA 2.0 provider). But as with any ORM: you need to know it
well (ActiveRecord is not an exception either).

Additionally, JPA 2.0 provides Level 2 Cache API interface: you can either
write your own but conform with the API (the API is very simple) or use the
one provided by the JPA provider.

Hibernate (if you use it as the JPA 2.0 provider) supports a variety of L2
caching solutions (SwarmCache, EhCache, OSCache, JBoss Cache, Infinispan,
etc). Plug n play baby!

------
jsvaughan
Here is a video of a SkillsMatter presentation by GT on the same subject:

[http://skillsmatter.com/podcast/nosql/how-we-mostly-moved-
fr...](http://skillsmatter.com/podcast/nosql/how-we-mostly-moved-from-java-to-
scala)

