|
|
|||
Scala/XML vs Java/XML
Having worked in mostly process-oriented programming environments, I've watched new languages pop up over the last fifteen years and seen my companies still stick to the basics: ANSI C, ANSI C++, Java. Much of the static use of these (at least in my environments) was the availability of Enterprise standards (think architecture and infrastructure) that were built on the industry standard use of these languages. One could pass a variety of industry certifications and assessments based upon "secure" coding best practices tied into a formal development process. So, as all these new languages and subsets of existing languages came along, they were mostly ignored and left to percolate for a decade or so while the kinks were worked out. Since Scala appeared in 2003, I thought I'd check back in 2013 to see what the state of the language is and how I can use it in my currently J2EE/SOA environments. Looking back, I'm sure Scala has already started to be tested by folks in previous companies of mine. Reading that it has already surpassed C#, and put the JVM back in the forefront, I can see why there is interest in the language. However, after reading about the Scala XML features (http://www.ibm.com/developerworks/library/x-scalaxml/), I'm having reservations about waiting. What are your thoughts out there regarding Scala XML vs Java XML, in say a SOA environment, such as web services in an healthcare information system environment, perhaps utilizing HL7?
Christian Bryant,
UCLA JUG Founder IT Project Manager 1 Reply
Scala's embedded support for XML literals is controversial with some people (it does add some complexity to the language), but it can make XML chores far easier to manage than doing them with Java APIs. For a nice example, see the lightweight Crochet web framework. The Lift Framework also exploits this feature.
Scala's XML support is not a full XML "solution". For example, it won't eliminate the occasional need for full XQuery capabilities. However, for what it does, it eliminates a lot of boilerplate coding when producing and consuming XML. You can read our chapter in Programming Scala about Scala's XML support here. Of course, you should evaluate the larger picture of how Scala would fit in your organization, but I'm never writing Java code again. Dean Wampler @deanwampler co-author of Programming Scala
Learn more about this topic from Programming Scala.
Learn how to be more productive with Scala, a new multi-paradigm language for the Java Virtual Machine (JVM) that integrates features of both object-oriented and functional programming. With this book, you'll discover why Scala is ideal for highly scalable, component-based applications that support concurrency and distribution. You'll also learn how to leverage the wealth of Java class libraries to meet the practical needs of enterprise and Internet projects more easily.
|
|||
|