Monday Jan 09, 2012

Interfaces on Demand with CDI and EJB 3.1

A new article by Java Champion Adam Bien, up on otn/java, “Interfaces on Demand with CDI and EJB 3.1” explains that since Java EE 6, interfaces are no longer required by the container in order to realize common use cases, thus enabling developers to use them more consciously and strategically for the realization of business logic. Bien shows how interfaces can now be used as vehicles for encapsulation or abstraction, as they were originally intended.

From the article:

“There is nothing wrong with the abstraction of every implementation with an interface if such an approach can be clearly justified, but interfaces become dubious when you have to introduce artificial naming conventions to avoid name clashes…
Interfaces should be introduced only as a contract for already existing classes, for the realization of Strategy or Bridge patterns, or when you need to design an API, such as Java Database Connectivity (JDBC), Java Message Service (JMS), and so on. In typical business applications, this occurs in only a fraction of all cases.”
Read the complete article here.


Tuesday Oct 18, 2011

JavaOne 2011 Recap

The 2011 JavaOne Conference, the sixteenth, had its own distinctive identity. The Conference theme, “Moving Java Forward,” coincided with the spirit that seemed to pervade the attendees – after more than a year-and-a-half of stewardship over Java, there was a clear and reassuring feeling that Oracle was doing its part to support Java and the Java community. Attendees that I spoke to felt that the conference was well put together and that the Java platform was being well served and indeed, moving forward.

For me, personally, it was a week in which my feet barely touched the ground as I rushed through tours from session to laptop to session, dashing off blogs and racing back to events, socials, awards ceremonies, BOF's and more.

The Keynotes

Start with the keynotes. Monday’s Technical Keynote debuted and open-sourced JavaFX 2.0, looked ahead to Java EE on the cloud and reminded us that there are about 6.5 billion people in the world and five billion Java Cards.

Tuesday’s Java Strategy Keynote offered Oracle's long-term vision for investment and innovation in Java.

Thursday’s Java Community Keynote while touched by the awareness of Steve Jobs’ passing, celebrated Java User Groups, Duke’s Choice and JCP award winners, and was capped off with the inimitable Java Posse.

Sessions, Sessions, and more Sessions

And then there were the sessions!

JavaFX 2.0, which was represented in more than 50 sessions, deserves special mention.

There was a lively panel discussion of the future of Java EE and the cloud.

Oracle’s Java Technology Evangelist Simon Ritter, in his session, showed off a fun gadget that worked via JavaFX 2.0.

Oracle’s Greg Bollella and Eric Jensen, gave a session titled “Telemetry and Synchronization with Embedded Java and Berkeley DB” that presented a vision of the potential future of Cyber-Physical Systems

Java Champion Michael Hüttermann explained best Agile ALM practices in a session.

Oracle’s Joseph Darcy took developers deeper into the heads and tails of Project Coin.

A JCP panel talked about JCP.next and the future of the JCP.

The JCP Awards gave recognition to some well-deserving people.

Oracle’s Kelly O’Hair gave a session on OpenJDK development best practices.

Oracle’s Terrence Barr showed developers how to get started with Embedded Java(http://blogs.oracle.com/javaone/entry/getting_started_with_embedded_java).

The Duke's Choice Awards reminded us of the sheer ingenuity of Java and Java developers.

Adam Bien, Java Champion, Java Rock Star and winner of Oracle Magazine’s ninth annual Editors' Choice award as Java Developer of the Year was all over the place.

Go to Parley’s.com to take in some of the great sessions.

Monday Oct 17, 2011

The Road to Java EE 7: Is It All About the Cloud?

PanelWith considerable enthusiasm I attended “The Road to Java EE 7: Is It All About the Cloud?” (23423) session, a panel of EE experts, late Wednesday morning at JavaOne 2011. I always find Java EE developers and architects to be among the smartest people around. Last year’s Java EE panel session, covered on otn/java and titled, “Where We Are and Where We’re Going” was fraught with more uncertainty about the future of Java EE. This year, it’s clear: Java EE is heading towards the Cloud. The session this year was packed even in a much larger room than last, with roughly three times the number of attendees as last year.

The panel consisted of the following people:
--Adam Bien, Consultant, Author, Java EE Expert
--David Blevins, Apache Software Foundation
--Emmanuel Bernard, JBoss Platform Architect, Red Hat
--Reza Rahman, Senior Software Engineer/Community Outreach Activist, Caucho Technology
--Linda DeMichiel, Java EE 7 Specification Lead, Oracle

The panel, moderated by Oracle’s Alexis Moussine-Pouchkine, Java EE Developer Advocate, Oracle France, addressed many issues, including:
• The current state of Java EE 6 adoption
• The motivations for Java EE 7
• What the cloud really means for Java EE 7
• Modularity in Java EE.next
• Better streamlined component models
• Status of ongoing work in the JCP
* Services and resources provisioning.
* Virtualization intersection between virtualization and PaaS?
* Meta-data: are XML deployment descriptors good after all?

Look for a detailed blow-by-blow account of the discussion on otn/java in coming weeks.

Wednesday Oct 05, 2011

Moving Java Forward -- Java Strategy Keynote JavaOne 2011

Java Roadmap

Tuesday's Java Strategy Keynote presented Oracle's long-term vision for augmented investment and innovation in Java -- from mobile and handheld devices, to the desktop, to the Cloud.

[Read More]

Thursday Sep 22, 2011

Integration Testing for Java EE

A new article by Java Champion Adam Bien, now up on otn/java, titled “Integration Testing for Java EE,” explores the intricacies of integration testing, which is done after a successful execution of unit tests, which however, will often fail. According to Bien, unit tests are fast and fine-grained while integration tests are slow and coarse-grained.

From the article:

“Testing everything inside an embedded container is convenient but unproductive. Java EE 6 components are annotated Plain Old Java Objects (POJOs) and can be easily unit tested and mocked out (see my previous article, “Unit Testing for Java EE.") with Java SE tools such as JUnit, TestNG, or Mockito. Using an embedded container to test your business logic is not only unproductive, but it is also conceptually wrong. Unit tests should validate your business logic, not the container behavior. Also, the majority of integration tests could be easily performed with a local EntityManager (see Listing 1) or a mocked-out container infrastructure. Only a fraction of all integration tests can be beneficially implemented with embeddable containers or test frameworks such as Arquillian.”

Read the complete article here.

Wednesday Sep 07, 2011

Unit Testing for Java EE tech article on OTN

A new article, titled “Unit Testing for Java EE,” by Java Champion Adam Bien, is up on otn/java’s front page. Bien points out that too many developers believe that testing Java EE applications is too hard, inconvenient, or complex, something that has not been true since the advent of Java EE 5 more than five years ago.

Bien explains: “There is nothing special about unit testing Java EE 6 applications. You only have to add the JUnit library into your pom.xml file (see Listing 5) and put your classes into the src/test/java directory. All JUnit tests will be executed automatically during the standard Maven lifecycle: mvn clean install.”

He goes on to make use of “Mockito” an easy-to-use, open source mocking library. Bien writes:

“Mockito is able to create ‘smart proxies’ (a.k.a. mocks) from classes or interfaces. These proxies do not come with any behavior, but they are still perfectly usable. You can invoke methods, but will get the default values, or null, back. The behavior of the mocks can be recorded after their creation with when(mock.getAnswer()).then(42) syntax.

Mockito is perfectly suitable for ‘simulating’ any inconvenient classes, resources, or services. You can start with Mockito just by knowing a single class org.mockito.Mockito. The when-then ‘domain specific language’ is composed of static methods from the Mockito class. The org.mockito.Mockito class is well documented. In fact, the whole documentation set was generated from the JavaDoc markup in the org.mockito.Mockito class.”

Read the complete article here.

About

Insider News from the Java Team at Oracle!

duke
Links


Search

Archives
« March 2015
SunMonTueWedThuFriSat
1
4
6
7
8
11
12
13
14
15
16
20
21
24
25
26
27
28
29
30
31
    
       
Today