BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JavaOne 2015 Preview

JavaOne 2015 Preview

In preparation for JavaOne 2015, Oracle's keystone Java conference taking place this week in San Franciso, InfoQ spoke to some speakers that caught our eye in the session catalog from this year's conference.

HTML5 and JavaScript Clients in an Enterprise Application World

John Brock, Principal Product Manager, Oracle
Geertjan Wielenga, Principal Product Manager, Oracle

InfoQ: How does NetBeans fit into developing HTML5 and JS clients in enterprises?

Wielenga: NetBeans fits the pieces together. It provides, out of the box, tools for working with AngularJS and other key JavaScript frameworks, as well as advanced editors for working with JavaScript, CSS, and HTML. There's also a plugin for Chrome that enables interaction between Chrome and NetBeans, e.g., changes made in NetBeans are immediately updated to Chrome and when you click in the app in Chrome, whether on the desktop or a mobile device, you can immediately see where the related DOM element is defined in NetBeans. There's also integration with Cordova, among a host of rich features, which can be seen here:

https://netbeans.org/features/html5/index.html

And all of this is for free, in a really fast and responsive tool, if you download the HTML5/JavaScript bundle of NetBeans IDE:

https://netbeans.org/downloads

InfoQ: What are some of the key takeaways you hope people get from your session?

Wielenga: That the JavaScript ecosystem is a volatile environment, with new technologies coming and going all the time. And that, despite that, meaningful applications can be created in this domain, though you should always decide carefully which parts of the ecosystem are relevant to your needs and stable enough to use.

InfoQ: What is Oracle doing to ensure NetBeans stays relevant and innovative?

Wielanga: Continually asking the NetBeans community of 1.5 million users what its needs are, and continually evaluating the landscape of tools and technologies to see if and how NetBeans can help in using them.

Java 8 Stream API and RxJava Comparison: Patterns and Performance

José Paumard, CTO, JPEFI

InfoQ: What are some of the main differences between the Java 8 Stream API and RxJava?

Paumard: Both APIs are about Streams. One short answer could be: the Java 8 Stream API is about streams and RxJava is about reactive streams, which is the case. Beyond that, both APIs allow to write data processing pipelines. Both APIs can consume data from several sources at the same time, both can connect to custom sources. The biggest difference is that, in the J8 context, the pipeline pulls data from the source, where RxJava can listen to a source that produces data independently from the fact that there is something that listens to this production. This brings new problems to the design of our data processing pipelines. The main question being: what happens if our pipeline is not fast enough, and cannot consume all the data produced. This leads to the question of the backpressure, and several different solutions, that depend on the use case considered. It is possible to combine Java 8 Streams with the Java 8 CompletableFuture to build reactive streams with the JDK 8. It provides everything we need, but it is hard to set up. We definitely need easier model to build our applications.

InfoQ: Do you feel that RxJava is the wave of the future?

Paumard: There is currently a lot of activity around the question of reactive streams. RxJava is one of the answer, and there others. There is currently an effort to create a Reactive Stream API in the JDK, that should make it to 9. I will describe this API in my other talk "Going Reactive in Java". The effort in 9 is to provide a common setup of interfaces and some classes to allow the interop of all the reactive APIs (http://gee.cs.oswego.edu/dl/jsr166/dist/docs/ then look for the Flow class). Written as it is, RxJava is not something I would recommend in Java. The API is complex, based on one main humongous 10k lines and 250 methods class: Observable. We are quite far from "clean code", and the massive use of static methods makes testing a nightmare. In fact RxJava is a transcription of a .NET API. As a transcription, it has several drawbacks, performance being one of them. RxJava can be efficiently used in some use cases, but not in others. In a nutshell, reactive patterns bring many things that modern applications need. It is still a work in progress, some common problems still need to be addressed. New tools are being developed, and, as developers or application architects, we definitely need to keep an eye on this subject.

InfoQ: What do you think about the Spring Team's recent announcement about Spring 5 focusing on reactive architectures?

Paumard: I am not surprised to see the move Spring announced recently toward reactive architectures. Spring is always on the edge of new programming models, and they showed us in the past that they could even create such models. Reactive works very well with microservices, providing a very clean and easy to setup model for combining, chaining and composing microservices, along with very elegant ways of dealing with exceptions. The question of the backpressure is a tough question, that can be addressed on a per use case basis. I'm pretty sure we'll see more new things on this subject in the future.

Java 8 in Anger

Trisha Gee, Developer Advocate, JetBrains

InfoQ: Is there any reason developers should be using Java 7?

Gee: Not that I can think of! It's end of life, and certainly doesn't provide any advantages over 8. I can see that people might be stuck on Java 6, due to organisations sometimes being conservative with adopting new technologies, but I'm also seeing that a lot of those organisations are jumping straight from 6 to 8.

InfoQ: From the title of your talk, I'm guessing you've used Java 8 quite a bit and found some things you didn't like. What didn't you like? Will Java 9 fix any of these problems?

Gee: Ah - this is a common misconception, and I'm beginning to regret naming my talk that! "In Anger" means "In Practice" or "In Real Life" - it's generally a Britishism, but even then not everyone's heard of the term! The aim of the talk is to show using Java 8 in a fully working app rather than just slide-ware of "this is a lambda" and "this is a stream".

As for Java 9, that's definitely got some interesting things in it, but I suspect it will have a much smaller impact on day-to-day development than Java 8 has had (having said that, there are some additions to the Streams API in Java 9 that will definitely address the one thing I disliked about using infinite streams).

InfoQ: What are some of the key takeaways you hope people get from your session?

Gee: I want people to see how the new features feel to work with as a developer - not just to be aware of new syntax, but to understand when and where you might use lambdas and streams (in particular), how it changes the way you think about a problem. I also want to show some of the decisions you have to make when thinking about whether Java 8 provides a better solution, or if traditional approaches might be simpler or more understandable. Finally, I also hope to show how your IDE (IntelliJ IDEA in my case, obviously!) can help you migrate from your traditional way of working to using the new features.

Introduction to MVC 1.0 (JSR 371)

Santiago Pericas-Geertsen, Consulting Member of Technical Staff, Oracle

InfoQ: Why should developers use MVC 1.0 over popular frameworks like Spring MVC?

Pericas-Geertsen: Because MVC 1.0 is a standard API that will be part of Java EE 8 and, thus, supported by multiple vendors. Because it is also based on the popular JAX-RS API which a lot of developers already use.

InfoQ: JavaScript MVC frameworks seem to be more popular than traditional server-side MVC frameworks these days. In a world where MVC on the client is popular, why do we need MVC on the server?

Pericas-Geertsen: When it comes to Web UI frameworks, there is no one-size-fits-all solution. There have been reports of companies moving from server-side to client-side and then back to server-side after finding some performance problems. Client-side frameworks based on JS are great, but I believe there's room both architectures to coexist in the next decade. The right tool for the job.

InfoQ: What are the key takeaways you hope attendees get from your session?

Pericas-Geertsen: Learn the basics about MVC 1.0, its relationship with JAX-RS and extensibility points. Gather enough information to consider MVC for your next project.

Modern Web Apps with HTML5 Web Components, Polymer, and Java EE MVC 1.0

Kito Mann, Principal Consultant, Virtua, Inc.

InfoQ: You're talking about Java EE MVC, and you're a long-time JSF advocate. What do you think of MVC 1.0 vs JSF?

Mann: I don't think it's necessarily an either-or proposition. Java EE MVC is an action-oriented framework, like Spring MVC. For some teams, a traditional action-oriented MVC framework is a good choice, and for others, a component-oriented MVC framework like JSF is a good choice. And, if you for some reason you need both models, it's entirely possible as well. Initially we considered building MVC on top of JSF (which is entirely possible), but the it was decided to keep it separate.

InfoQ: JavaScript MVC frameworks seem to be more popular than traditional server-side MVC frameworks these days. In a world where MVC on the client is popular, why do we need MVC on the server?

Mann: I've been in this industry long enough to know that architectural preferences often swing back and forth as we learn more of the pros and cons with any given approach. There's never going to be a single architectural model that fits every case. Putting everything on the server limits what you can do in the browser and increases your hardware needs; putting everything on the client allows you to scale more, but places more of a burden on the client, which can be challenging when you have many different browsers on many different hardware platforms. I think the sweet spot may be somewhere in the middle -- using the server more than pure JS frameworks do, but less than pure server-side frameworks do. But regardless of the use-case, the key point is that the Java EE platform must support all of the different options.

InfoQ: If I'm a developer writing webapps with web components and Polymer, why should I use MVC 1.0 on the server instead of JAX-RS?

Mann: What's great about MVC is that it's built on top of JAX-RS (initially we discussed it being part of JAX-RS, but the JAX-RS EG wanted to keep it separate). It's actually a small layer on top of JAX-RS. So you can easily mix-and-match pure REST services with web app features that handle some routing and return views (which can be in Facelets, JSP, or any other technology, such as Velocity or Thymeleaf). This allows you to take advantage of server-side templating and data binding where it makes sense.

How Netflix Thinks of DevOps—Spoiler: It Doesn't.

Dianne Marsh, Director of Engineering, Netflix

InfoQ: Netflix has been a pioneer in cloud usage and creating open source cloud tools. What open source tools do you recommend for making cloud deployments and monitoring easier?

Marsh: Asgard has been the state of the art for cloud deployments for many years. We're working on a new deployment tool that builds on what we learned from Asgard, and is actually a continuous delivery platform rather than just a deployment tool. With stages that manage the workflow, this is going to e a powerful tool. Look for it in the next few months.

For monitoring, our Atlas tool has worked well for us, but not everyone needs something this complex. What I think is essential is the Janitor Monkey, which cleans up after unused instances in the cloud to help manage our costs -- no need to pay for what you don't use.

InfoQ: As more developers take over operations roles, is there a future for the traditional sysadmin?

Marsh: Sysadmins do a completely different job than developers who deploy and run their own services. Sysadmins manage third party tools, for example. Developers run what they build and that's often significantly easier than managing a tool where you can't crack open the code and fix a bug!

InfoQ: What are some of the key takeaways you hope people get from your session?

Marsh: DevOps is quite the overloaded term. Like agile before it, we need to be careful not to lump a bunch of things into one and assume that they are all equivalent. But mostly I hope that people will leave my session with both an appreciation for tools that provide insight into what's going on with their services, and which tools can benefit them in their own companies.

Introducing the Oracle Internet of Things Cloud Service

Harish Gaur, Sr. Director of Product Management, Oracle
Pete St pierre, Principal Product Manager, IoT Cloud Service, Oracle

InfoQ: What is the Oracle Internet of Things Cloud Service?

Gaur: IoT Cloud Service is a new addition to Oracle PaaS portfolio. Oracle Internet of Things Cloud Service enables customers to securely connect to any device, perform real-time & predictive analytics on device data and extend business processes within enterprise applications. It will allow rapid development of IoT applications for preventive maintenance and asset tracking using pre-built integrations with Oracle PaaS, Oracle and 3rd party SaaS applications including JD Edwards, Oracle E-Business Suite & Oracle Fusion Applications.

InfoQ: Who is your competition and how is your product better?

Gaur: IoT is a crowded marketplace. There are several vendors offering point solutions, but Oracle is unique in several ways:

a) Platform: Oracle is the only vendor which provides a complete integrated platform spanning across smart gateways, device connectivity, security, analytics all the way to enterprise applications. IoT CS provides out of the box connectivity with several enterprise applications to enable quick development of IoT applications.

b) Device Virtualization: Firstly, it will allow you to connect any devices with the rest of the enterprise. We expose every device as a set of simple APIs. Which means that enterprise applications like CRM or service Cloud can talk to these devices without worrying about technical nuances such as transport protocols or message formats.

c) Security: Security is of paramount importance. Oracle IoT Cloud Service makes devices first class citizens (just like apps or users) within an enterprise and provides end-to-end security.

d) Analytics: Oracle IoT Cloud Service enables real-time, historical, big data and predictive analytics on device data. This allows customers to make sense from barrage of data flowing from devices, identify key patterns and exceptions and drive decision making.

InfoQ: Are you targeting enterprises with this offering, or are you hoping to target developers? Will you offer free access to students and open source projects?

Gaur: We are targeting enterprises in industries like industrial manufacturing and transportation and logistics. Yes, we are offering free trial to customers/partners to test drive IoT Cloud Service. Several technology components of IoT Cloud Service are open-sourced including IoT Cloud Service client library.

Building iOS Apps with Java 8

Shay Shmeltzer, Director of Product Management, Oracle

InfoQ: I worked for Oracle a few years ago and we used a "TAP" framework for the iPad that looked like JSF and allowed developers to write XML to author iOS apps. Does your session talk about this framework, or is there something newer and better?

Shmeltzer: My session talks about Oracle MAF - which is probably an evolution of what you used in the TAP days. MAF is an MVC based framework running on the device leveraging Java. You use XML to define the View which is rendered with HTML5, you use Java to write your controller and model layers.

The app you build works on both iOS and Android. Oracle internally has been using MAF to build over 100 apps that are now offered on the iTunes and Google stores.

InfoQ: Why do you think developers should use Java to build iOS apps?

Shmeltzer: There are millions of Java developers out there, and what we allow them to do is to continue and use the skills they have and transfer them to on-device mobile development. You use the language that you know (Java 8), the IDE you know (Eclipse or JDeveloper), the architecture and methodology you know (MVC, POJOs, Component based UI definition).

For IT shops who invested in Java, we are bridging a skill gap and allowing them to leverage their existing development resources when creating on-device apps.

InfoQ: What are some of the key takeaways you hope people get from your session?

Shmeltzer: If you are a Java developer - there's a solution that will allow you to leverage all the skills you already have and seamlessly transition to the new mobile device development world.

Groovy with Style

Guillaume Laforge, Product Ninja and Advocate at Restlet, Restlet

InfoQ: I noticed your recent article that Groovy has doubled its downloads since moving to Apache. Do you think this is mostly because of Android?

Laforge: Directly, a little bit, as we see successful Android apps rewritten in Apache Groovy, like the New York Times Android app, as explained in this blog:

http://open.blogs.nytimes.com/2014/08/18/getting-groovy-with-reactive-android/

And indirectly as well, as Google has chosen to use the Gradle build automation tool to make Android developers build their Android apps. As Gradle is using Groovy for its DSL, naturally more and more mobile developers are acquainted with Groovy.

But more generally, we see Gradle as a key drive to Groovy adoption beside Android, as lots more companies and big projects are moving to Gradle builds.

Last but not least, I also believe that moving Groovy to the Apache Software Foundation is a driver in itself, as developers understand that Apache Groovy is here to stay, for the long run, is already very mature and well trusted by developers.

InfoQ: Can you share your top three tips for being more productive with Groovy?

Laforge: Ah! It's tricky, I have to pick up only three!

1) First of all, it's okay to code like in Java, as Groovy is a kind of superset of Java. But as you're learning Groovy, you'll progressively learn about new tricks, to make your code more concise, more expressive, more solid.

2) Secondly, learn the GDK (Groovy Development Kit). Apache Groovy provides tons of nice APIs, methods decorating JDK classes, that are very useful, and provide loads of productivity gains once you've adopted those.

3) Last but not least, the notion of type contract is important. You could use "def" everywhere and make any variable, parameter, field, etc, all dynamically typed, but it's not a good practice. It's important to define clear contracts for your APIs, the things you manipulate. So you should use proper types when declaring your variables, parameters, fields, as it'll help with interoperability with Java (when you mix and mash both languages in the same project), it'll help with documentation (think JavaDoc/GroovyDoc), your compiler will also be happier with better code assistance (navigation, code-completion, possible errors, etc.).

And you can also use @CompileStatic or @TypeChecked annotations to further help in this regard as well.

InfoQ: What are some of the key takeaways you hope people get from your session?

Laforge: I think it depends who comes to my session: hopefully the Groovy developer veterans will learn a few cool new Groovy tricks that they'll be able to put to good use in their projects, the ones new to Groovy will discover its powerful features, and the skeptics might revise their judgments and reckons all the nice things Groovy has to offer in terms of productivity, code readability, powerfulness, Domain-Specific Languages, etc.

I believe there's something to learn for everybody!

How to Thrive on REST/WebSocket-Based Microservices

Pavel Bucek, Principal Software Engineer, Oracle
Michal Gajdos, Software Engineer, Sapho

InfoQ: According to caniuse.com, websockets are supported in all major browsers. Is there any reason developers shouldn't be using websockets?

Bucek: In terms of browser / client support - no, everything is already there, you can easily use it any issues. There are even frameworks which can emulate websocket connection using long-polling when it's required, but I don't even consider those important, since there is not really a good reason for using them.

There might be some issue related to backend infrastructure requirements, which might be little different compared to "standard" applications, but if the backend already supports https or something else which provides more persistent connections, it shouldn't be an issue.

InfoQ: I've heard "REST is dead" and Reactive APIs are the next big thing. Do you agree with this notion?

Bucek: REST is dead is nonsense; REST is and will be used simple and effective "RMI protocol, i haven't even noticed something which would try to replace it.

"Reactive APIs are the next big thing" - agree. In terms of currently evolving infrastructures, you want to do something asynchronously, ideally more than one "thing" - REST client call for example combine them a and produce one response based on all received responses - that's something which can be done quite easily when using reactive APIs, without blocking and additional thread or having to think about synchronization issues.

InfoQ: What are some of the key takeaways you hope people get from your session?

Bucek:

  • WebSocket and REST are not competitors, they are complements.
  • If you need effective bi-directional communication and slow response time in your browser (or standalone app), you should consider using WebSocket protocol.
  • WebSocket is not replaced by HTTP/2.

InfoQ would like to thank these speakers for responding to our questions. JavaOne 2015 has many other sessions besides the ones mentioned here. Attendees will have opportunities to learn about new Java language changes, modern enterprise applications, rich client-side solutions, IoT development targeting smart devices, and developing web services in the cloud.

The Java Keynote, Accelerating Java for a Connected World, will take place Sunday, October 25 from 1:45-4pm PDT. You can stream it live at http://www.oracle.com/javaone/live.

Rate this Article

Adoption
Style

BT