Book Review: Flex 4 Fun

Posted in Jon Rose on September 27th, 2010 by jonr

jonr originally posted this on Jon Rose's Blog.

I’ve been working with Flex since 2007, starting with version 2.0.1. Also, I’ve been working with Flex 4 for a few months. So, recently, when I went looking for a Flex 4 book, I wanted something that gave me depth and clarity around the latest API’s and features. Chet Haase’s Flex 4 Fun is perfect for this, as he writes it for the existing Flex developer who wants to learn how to harness the power of Flex 4.

Chet begins the book with an excellent tutorial on the concepts of graphics and filters, which are largely foreign to developers, like myself. After reading Chet’s book, I feel like I can finally take advantage of much more of the power of underlying Flash player when building Flex applications. And, that is key because these concepts have become very important with the latest Flex 4 features, like skinning. Chet proceeds to teach about those features, like skinning and animations (his baby – he worked on animations as part of the Flex 4 SDK team).

Overall, I found the book enjoyable and it really help me to add a depth of understanding around the latest Flex 4 features. In addition to the technical content, Chet, the master of the pun, always makes his content fun to read.

You can find the book on Amazon.com or Artima.com.

JavaOne: Amy Fowler’s Feelings on JavaFX and Swing

Posted in Uncategorized on September 21st, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

Though I've never met her, I have deep respect for Amy Fowler as an engineer and leader of JavaFX design and development at Oracle. She's helped to review the book on JavaFX that I co-wrote with Jim Clarke and Jim Connors, and she's written some very intelligent articles and blogs on Java client-side programming over the past few years. From what I've heard, she's been a huge driving force for JavaFX within Sun and now Oracle.

If want to read some deep insight, and truth, on the future of JavaFX and Swing, as well as the death of JavaFX Script, I recommend you read her recent blog post on the subject.

I don't work for Sun/Oracle anymore, so it's with total honesty that I say I feel completely confident and comfortable with Oracle's Java and JavaFX plans for the future, having seen and listened to the material coming from JavaOne this week. Stay tuned as I continue to summarize and link to the best nuggets of information coming from the conference.

JavaOne: Java GC Myths

Posted in Uncategorized on September 21st, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

My friend, and genius Java GC expert at Oracle, Tony Printezis is giving a talk on Java GC and HotSpot tuning at JavaOne. His talk will be on Thursday, where he'll discuss this topic, as well as work being done to improve Java GC for low-latency collection, even with very large heaps.

He will also talk about what he calls " The Eight Myths about Garbage Collection":

1-Reference counting GC will solve all my latency problems.
2-Malloc/free will always perform better than GC.
3-Finalizers should be called promptly, as soon as objects become unreachable.
4-Garbage collection will eliminate all memory leaks.
5-Life would be so much better if I could explicitly deallocate some important objects, since I know when they're unreachable.
6-I can get a GC that delivers both very high throughput and very low latency.
7-I need to disable GC in critical sections of my code.
8-Anything I can write in a system with GC, I can write with malloc/free.

JavaOne Slides: JavaFX Your Way

Posted in Uncategorized on September 21st, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

Here, you can find the slides from Jonathan Giles' and Stephen Chin's JavaOne presentation, "JavaFX Your Way," where they discuss the proposed changes to JavaFX. You'll see early examples of JavaFX programming with Java, Scala, Groovy, and JRuby. Their disclaimer is that this is all in the proof-of-concept phase, but it's quite interesting nonetheless.

JavaFX, Open Source, and other announcements

Posted in Uncategorized on September 20th, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

Thomas Kurian of Oracle announced that all of the JavaFX UI controls will be released to open-source when JavaFX 2.0 is release. Additionally, NetBeans will continue to be the premier Java IDE, with two releases already planned for 2011. In fact, there has been a 20% increase in downloads and usage of NetBeans over the past six months.

By opening up JavaFX to simpler Java-based APIs, through continuing improvements to the Oracle HotSpot JVM, and an improved hardware-accelerated rendering engine, JavaFX applications will benefit from an immense improvement in performance and efficiency. Nandini Ramani demoed a very complex JavaFX media application with thousands of nodes, and dozens of simultaneous HD video previews running. The performance was very impressive, especially considering the technology is not quite complete and has not yet been released.

The JavaFX API will not only be available to Java and other languages, it will be unified no matter what your target is: the desktop or the browser. In the browser, the implementation will include an HTML5/CSS rendering engine that works with modern browsers across OSs and platforms to bring HTML5 application development to Java developers transparently.

The Java VM will see improvements specifically around garbage collection for large-heap applications. The example given was a VM with low-pause collector (sub-second) with heaps in the terabyte range,

Moving on, improvements to Java EE planned for 2011 include continuing the simplification of enterprise Java applications. This includes the use of Glassfish and annotations to make it easier to launch REST-based services and other enterprise Java applications. Java EE profiles are continuing to be defined, and Oracle is looking to the community to define these profiles to meet the precise needs of enterprise developers.

Overall, Oracle is expressing their commitment to open-source development through Glassfish, NetBeans, and at least portions of JavaFX going forward. Also, Java ME will continue to be developed, and used to target lower-cost feature phones to allow people to develop world-class applications on these billions of devices. But the story doesn't end with mobile phones, but continues with other mobile devices such as Kindles, smart pens, desktop-integrated VOIP phones, and new classes of applications based on the JVM.

A lot of this discussion has been seen in the past, but something new discussed at JavaOne is the use of Java as a serious game development platform. This isn't a rehash of Chris Mellasinos and his research project, Project Darkstar, but instead a real platform ready to support millions of online gamers today. A demo was shown with the Java-based gaming platform running Star Wars: The Old Republic, which you can experience for yourself at www.starwarsoldrepublic.com.

Java FX 2.0 Details

Posted in Uncategorized on September 20th, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

Oracle has just posted the roadmap for JavaFX 2.0 here. Also, you can hear the plans first-hand via the JavaOne "Future of Java" keynote taking place on the web here.

In summary:
-JavaFX Script will be going away in favor of a Java API that can be called via Java and other dynamic languages
-Binding and triggers will be supported via Java
-Support for multi-threading will be enhanced
-New classes and support for sequences and observables will be added
-Smaller on-disk and in-memory footprint
-Far better performance
-Improved startup time
-Complete keyboard focus and navigation support
-Extensive, comprehensive, blueprints, best practices, and examples will be included
-Improved animation transitions
-Texture painting added
-Improved layout and containers
-Improvements to media support including HD video, low-latency audio, full-screen support, media markers for easier programming around video
-Many other improvements including an integrated web browser, various UI controls, a media player control, and a new plugin that supports Prism (a new high-performance rendering engine).

Mark Reinhold announces Java SE 7 plan

Posted in Uncategorized on September 20th, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

Last week, Mark Reinhold proposed breaking JDK7 into two releases: JDK7-lite, and JDK8 to follow closely behind. This was described as "Plan B", with "Plan A" being Java SE 7 released with all of the features planned for JDK7. Today, Mark announced that Oracle will go with Plan B, which is:

-JDK 7 (minus Lambda, Jigsaw, and part of Coin) - released Mid 2011
-JDK 8 (Lambda, Jigsaw, the rest of Coin, ++) - released Late 2012

A new milestone schedule will be posted on the OpenJDK site here: http://openjdk.java.net/projects/jdk7/milestones

Mark also made it clear that Oracle has no plans to dismantle the OpenJDK, as they did with Open Solaris. In fact, all of Java SE development will continue in the open, as part of the Open JDK projects. This development will be open and available to the Java community.

JavaFX 2.0

Posted in Uncategorized on September 20th, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

What do you call JavaFX without the scripting language and without JavaFX Mobile. Apparently Oracle calls it version 2.0? Richard Bair summed it up as a hardware accelerated graphics library with some new controls and a Java API. Rumors suggest that the API will be accesible via other JVM languages such as Groovy. This actually sounds positive to me except for one thing: delivery Q3 2011.

I'm concerned about JavaFX losing what momentum it currently has as people stop working with JavaFX Script in anticipation of the new Java APIs. More details to come, I'm sure -stay tuned!

Overview of How FlexMonkey Works

Posted in FlexMonkey on September 20th, 2010 by jonr

jonr originally posted this on FlexMonkey :: Flex UI Testing Tool.

FlexMonkey is a very useful tool for Flex developers, as it makes testing much easier, yet FlexMonkey is also a real-world Flex application itself.  This post aims to provide a high level overview of the FlexMonkey architecture, so you can begin to understand how it works – it is a summary of a recent doc published by Stu Stern, the FlexMonkey project founder.

It is not essential for users to fully understand the ins-and-outs of FlexMonkey to be able to use it for testing.  However, understanding how it works is a great way to learn more about the Flex platform and have a leg up on solving any issues you might encounter working with the tool.  A deep understanding of the architecture will also make it much easier to record and playback tests on custom components.

FlexMonkey utilizes the Flex automation framework provided by Adobe to enable visibility into the application being tested.

Automation Framework

The automation framework is a Flex / AIR component level API provided by Adobe that assists tools like FlexMonkey in providing record and playback functionality with visual components (i.e. classes that extend from UIComponent, as all the Flex SDK visual components do).

  • Access to the Automation Framework: Adobe packages the automation framework with Flash Builder Pro.  They do distribute the SWC archives and delegate source outside of Flash Builder, but without a Flash Builder license the AutomationManager limits the number of record and playback events that can be done in a single session.
  • Delegate Classes: The automation framework instruments components through delegate classes.  These classes use [Mixin] metadata that causes them to be statically initialized at the startup of the application.  They have the component specific logic to accomplish record and playback.
  • Automation Children Methods: The automation framework uses three key methods to crawl the application component tree: getAutomationChildern(), getAutomationChildAt(index:int), and numAutomationChildren(). These methods can be implemented directly on the component classes (e.g. DataGrid, Label, and any other classes that extend UIComponent) or in the delegates.

FlexMonkey

FlexMonkey gives you the tools to create powerful tests.  Here are the major pieces of FlexMonkey:

  • Console: The main part of FlexMonkey users interact with is the Adobe AIR console.  It is used to record and edit tests.  Developers and QA professionals can also use the console to run tests on their local machine.
  • MonkeyLink: MonkeyLink is compiled into the application being tested.  It communicates with the AIR console and FlexMonkey Ant task to create and run tests.
  • Commands: In record mode FlexMonkey creates commands that are used to do the playback of the recorded user interactions. The latest release supports “retry” for more consistent results when running tests.
  • Verification: As with any testing framework, assertions of a certain state are the ultimate goal.   FlexMonkey provides verification of property values, bitmaps on the screen, or DataGrid values.
  • Continuous Integration: The FlexMonkey project includes support for automating tests within a Continuous Integration environment.  FlexMonkey can generate ActionScript versions of the test from the AIR console.  It also provides Ant tasks for running them.  There are example projects for Flex and AIR Continuous Integration configurations on the FlexMonkey download page.
  • Environment File: MonkeyLink packages a FlexMonkeyEnv.xml file that describes the component tree to the automation framework.  The standard file works for all of the standard custom Flex components.  If you need to automate custom components, then this file may need to be modified.

The dependencies for FlexMonkey can be included in an application using the “-include-libraries” Flex compile directives.  These dependencies should only be included in developer and QA builds – never in a production release of the application being tested.

Hopefully, you now have a general understanding of how FlexMonkey works.  If you’d like more introductory on FlexMonkey check out the GorillaLogic.com website.

More info on JDK7

Posted in Uncategorized on September 19th, 2010 by Eric Bruno

Eric Bruno originally posted this on Dr.Dobb's Journal | Eric Bruno Blog.

>

Leading up to JavaOne10, Mark Reinhold has written a recent blog that further solidifies what Java SE 7 will look like. It includes most of what you'd expect (i.e. small language enhancements, NIO.2, Swing enhancements, InvokeDynamic, and so on) but there are new features as well. These features, never mentioned before, are most likely from work that Oracle was doing to JRockit prior to or during the Sun acquisition.

These include new internationalization features, additional NIO.2 filesystem enhancements, JDBC 4.1, Windows Vista networking improvements, and so on. Take a look at Mark's blog here for the details.