Wednesday Mar 07, 2012

Java Champion Jonas Bonér Explains the Akka Framework

In a new interview on otn/java, titled “Java Champion Jonas Bonér Explains the Akka Framework,” Jonas Bonér explores the intricacies of Akka, an open source platform for next-generation event-driven, scalable, fault-tolerant architectures on the JVM. He argues that the way concurrency is typically performed in Java with shared-state consistency is needlessly difficult, resulting in concurrent access to shared mutable state guarded by locks, which are notoriously hard to understand and get right. Locks, from Bonér’s perspective, do not compose, scale poorly, have complicated error recovery and are, generally, too low level.

From the article itself:

“Akka offers multiple solutions to the concurrency problem. It provides a toolkit for addressing concurrency, scalability, and high-availability concerns. It provides one thing to learn and one thing to use. Akka has multiple tools that will help you as a developer. Actors, futures, agents, and software transactional memory all raise the abstraction level and make it easer to write, understand, and maintain concurrent, scalable, fault-tolerant code. Instead of messing around with very low-level constructs, you think in terms of higher-level concepts such as message flows and transactions. What is usually solved by use of low-level plumbing in standard enterprise applications becomes workflow in Akka. So you start to think about how the data flows in the systems rather than how to get the concurrency and scalability exactly right.”

Read the complete article here.

Friday Feb 17, 2012

Michael Hüttermann on Agile ALM

A new interview on otn/java with Java Champion and Agile ALM expert Michael Hüttermann titled “Agile ALM: A Conversation with Java Champion and ALM Expert Michael Hüttermann,” explores ways to streamline the software development process through strategies that include task-based development, continuous integration, practical Scrum implementation, and more.

In the interview, Hüttermann explains the purpose of Agile ALM:

“Agile ALM provides structure for Agile. It’s up to the people who implement Agile ALM to apply Agile values (such as respect and open communication), Agile strategies (such as continuous integration, continuous inspection, and continuous deployment), and Agile processes (such as Scrum). It’s very important to be open-minded regarding the tools you use and to be free to switch from one tool to another. This is part of the continuous improvement process in which developers reflect continuously about what the team is doing and how to improve.”

He goes on to explore the strengths of different tool chains:

“One appealing tool chain integrates JIRA, Hudson, Eclipse, Mylyn, and FishEye. This tool chain fosters task-based development spanning different project roles and project phases. Another interesting chain is to connect Java with Scala and Groovy in order to leverage specific features of different languages on the Java Virtual Machine (JVM). This can be helpful, for example, for setting up an environment for specifying and developing software collaboratively. Scala, with the specs2 library, and Groovy, with the easyb library, are examples of writing acceptance tests or applying behavior-driven development on the JVM where programmers and testers share the same infrastructure and are, thus, forced to work together closely.”

Read the complete article here.

Thursday Feb 02, 2012

Java Champion Dick Wall on Genetics, the Java Posse, and Alternative Languages (Part One)

In Part One of a two-part interview, titled “Java Champion Dick Wall on Genetics, the Java Posse, and Alternative Languages (Part One),” Java Champion and Java Posse member Dick Wall explores the potential of genetic analysis to enhance human health, shares observations about alternative languages for the Java Virtual Machine (JVM), and reveals inside dope on the Java Posse. Wall admits to learning from Brian Goetz, Java language architect at Oracle, that pretty much everything he thought he knew about optimizing for the JVM was wrong, and discusses not only his current work using Scala to enhance our capacity to gain knowledge of our genetic vulnerabilities, but shares what he has learned about his own genetic challenges. In addition, he recounts some adventures with the Java Posse.

From the interview:

“…when I started working in Scala, I was worried that lots of extra immutable objects, which are created when you use immutable data often, would result in a lot more work for the garbage collector. After talking with Brian about it, I realized that, in fact, the opposite is often or usually true. Short-lived, immutable objects usually exist in a special part of the JVM’s memory referred to as Eden. Releasing the memory back to the pool from there is almost without cost. It is only longer-lived objects that get promoted to the JVM main heap that are expensive to garbage collect. So lots of small, short-lived objects can actually help the garbage collector out. There are other ways immutability can help or hurt performance, but ultimately, I decided to code for style and correctness first and worry about performance if and when it becomes an issue.”

Read the interview here.

Tuesday Oct 25, 2011

Perspectives on Garbage Collection

In a new article, part of the Developer Insight series, and titled “The Developer Insight Series, Part 6: Perspectives on Garbage Collection,” now up on otn/java, three leading Java developers offer insight into garbage collection.

Oracle Lab’s Ron Goldman notes, that, “Although automatic memory management has existed for more than 50 years, a lot of people still don't want it in their systems because it seems inelegant. It just strikes people as wrong – ‘It's my memory. I should be releasing it when I know it's no longer being used.’ Theoretically, that might be true, but in practice, programmers continue to forget to free up memory when they are done with it, or, even worse, try to free it up while it's still in use. The results? Buggy code that is apt to crash unexpectedly.”

Java Champion Kirk Pepperdine observes that, “Even though collection of very short-lived objects is almost free, high rates of object churn can still result in very inefficient GC numbers. Sometimes, the problem is simply that the Java Virtual Machine (JVM) doesn't have enough heap space. Monitoring GC activity will give you the hints you need for a successful heap-sizing exercise…”

And Oracle’s GC expert Tony Printesiz takes on eight myths about garbage collection, four of which are:

1. Reference counting GC will solve all my latency problems.
2. malloc and free will always perform better than GC.
3. Finalizers should be called promptly, as soon as objects become unreachable.
4. GC will eliminate all memory leaks.

The article provides a good context for developers to collect their thoughts about garbage. ;)

Read the complete article here.

Friday Sep 09, 2011

Client-Side Improvements in Java 6 and Java 7 Article on OTN

Java Champion Josh Marinacci has a new article titled “Client-Side Improvements in Java 6 and Java 7” up on otn/java’s "Developer Spotlight". The article takes a tour of Swing, looks at installation, and explores substantial improvements to the client and desktop parts of Java SE 6 and Java SE 7, including the applet plug-in, the Java Deployment Toolkit, shaped and translucent windows, heavyweight-lightweight mixing, and Java Web Start.

Marinacci concludes: “Finally, desktop Java apps benefit from many of the general improvements in Java SE 7. The improved file I/O APIs offer fine-grained control over file permissions, symbolic links, and notification of file changes, plus the ability to have the operating system move and copy files at native speed.

With the improvements in Java SE 7 and a new Java language version of JavaFX available this summer, things are looking bright for client-side Java.”

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
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today