January 27, 2012

IntelliJ IDEA 11.0.2 Release Candidate

This week we’re releasing a new Early Access Preview build for IntelliJ IDEA 11.0.2, which is also the Release Candidate for the new version. Besides the usual amount of bugfixes, a noteworthy change is support for new versions of Google Chrome in the JavaScript debugger plugin.

You can download IntelliJ IDEA 11.0.2 Release Candidate from the EAP page.

What's up with EclipseLink?

EclipseLink's Shaun Smith has recently been delivering a number of presentations on the status and future of the open source project. If you're curious about where innovative JPA projects are going, then you should check out this slide deck from Shaun.

ALT_DESCR

Here are the main themes covered:

REST: integration with JAX-RS to access relational data through REST with HTML 5 as the primary client with possibly JPA entities and persistence units defined via metadata with dynamic provisioning (i.e. no Java coding required).
EclipseLink NoSQL: annotations (@NoSql) and XML to identify NoSQL stored entities with initial support for MongoDB and Oracle NoSQL.
Multitenancy: already present in the shipping version of EclipseLink using the @Multitenant annotation and supporting different topologies with dedicated or shared application and/or database.

Next stop: EclipseLink 2.4 along with the June Juno Eclipse Release.

January 26, 2012

Upcoming NetBeans Feature: Generate Implementing/Extending Class!

Another upcoming NetBeans IDE feature, already in the daily builds, is this hint, which appears when you put the cursor in a class declaration:

Similarly:

When the hint is invoked, the new class, with all its required methods, is automatically generated, as a separate class (a dialog pops up letting you specify the name of the class and the package where the class should be created).

How handy these small enhancements can be!

This particular enhancement was included for 7.2 specifically because of a remark Arun Gupta made during Devoxx last year. That small discussion in a hallway resulted in this issue being highlighted and implemented:

http://netbeans.org/bugzilla/show_bug.cgi?id=49559

Just pointing this out as yet further evidence that we're really listening to users and, between balancing the various requirements coming in from various sides, are making very sure that user requests are taken extremely seriously.

JCP.next with merged Executive Committee - JSR 355

The latest JSR filed is #355 and it's not a technical one - "JCP Executive Committee Merge". As the name implies this is about merging the current ME and SE/EE executive committees into a unified one.

If you've been following carefully the changes planned for the JCP, the 2-step process turned into a 3-step evolution:
1/ JSR 348, JCP transparency
2/ Merging the two existing Executive Committees
3/ Sorting out the more complicated legal issues

ALT_DESCR

If you're curious about the role of the executive committee members, check out this page on JCP.org. Hint: voting on JSRs is part of it, but there's more. The JSR Review Ballot starts on February 7th.

January 25, 2012

Upcoming NetBeans Feature: Multi-Row Editor Tabs!

Several NetBeans users have been asking, for a long time already, for multi-row tabs in the NetBeans editor.

Read the list of use cases and requests around this area in the issue:

http://netbeans.org/bugzilla/show_bug.cgi?id=172512

Today, Stan Aubrecht, the NetBeans Platform window system engineer, closed the above issue. Why? Because he fixed it. In the Options window, you'll see several new options in the Appearance tab:

Above, the "Tabs placement" and "Multi-row tabs" options did not exist before today. As you can see, not only will you be able to set multi-row tabs, but you'll also be able to set where the tabs should appear, whether they're multi-tab or not.

Here you see multi-row tabs, with "top" tab placement:

Multi-row tabs, with "bottom" tab placement:

Multi-row tabs, with "right" tab placement:

Of course, anyone creating their applications on the NetBeans Platform will automatically inherit this behavior too, if they're creating document-centric NetBeans Platform applications.

With this new level of flexibility, you're able to get even more comfortable in your development environment than before.

Thanks, Stan!

January 21, 2012

Use Target Definition Files in PDE Build

I’m not hip when it comes to building Eclipse based products. I still use plain vanilla PDE Build. The cool guys all switched to Tycho. Well, you’re allowed to call me dinosaur then. Anyway, I’ve been using .target files as a source for dependency management for quite a while now. They are very useful in Eclipse. All dependencies for all the bundles are defined in one place. You simply open one and Eclipse starts downloading one half of the Internet. Maven already did the other half, I’ve heard.

I also use them to drive PDE Build. Instead of specifying stuff to fetch for a build again I simply point PDE Build to the same .target file I use in the IDE. Works like a charm as long as you only use “Software Sites” (p2 repositories) which are accessible via URL by any developers Eclipse instance as well as the build machine.

Previously, this was implemented by transforming the .target file XML using XSL into an Ant script. The Ant script did a bunch of p2 mirror calls to download the bytes. I recently upgrade to a newer version of the builder containing a Juno version of the org.eclipse.pde.core bundle. Starting with 3.8 this bundle defines a nice Ant task that does not require the XSLT magic.

<target name="buildTargetPlatform" unless="skipTargetDefinition">
  <!-- note: this requires pde.core (from Juno) in the base builder -->
  <pde.provisionTargetDefinition
      targetFile="/path/to/my.target"
      destinationDirectory="${repoBaseLocation}/target"
      clearDestination="false"/>
</target>

January 20, 2012

IntelliJ IDEA 11.0.2 EAP

Today we’ve published the first Early Access Preview build for the next bugfix update of IntelliJ IDEA 11. The main highlights include:

  • Perforce integration uses ‘p4 move’ command for moves and renames when available;
  • Spring integration performance improvements;
  • Other bugfixes listed in the release notes.

You can download the new build from the EAP page.

Eclipse job in Böblingen

We (Verigy) have a job opening for a Java / Eclipse developer in Böblingen / Germany. Details on G+.

Upcoming Events

I know some of you already finished planning for the next few months. There are a couple of interesting events I’ll attend which might be of interest for you. Thus, I thought sharing won’t hurt.

FOSDEM (Feb. 4 – 5, Brussels, Belgium)

I’ve never been in Brussels before. I’ve also never been at FOSDEM before. Andrew told me about his plan to generate some nice Eclipse buzz there. Well, it looks like that will turn out great. Mike will be there too. We’ll have an Eclipse stand for people to show some projects and talks about Eclipse and we’ll also give a few talks about Eclipse. Mine will be about EclipseRT.

EclipseCon (March 26 – 29, Reston, Virginia, USA)

Ok, this one is a classic (for me). I’ve been there before. You gotta have to be there! However, this year my flight to EclipseCon will be shorter. The event moved from the west coast to the east coast. Frankly, I always wondered about switching location away from Santa Clara. But I’ll also miss San Francisco. It’s a beautiful city always worth a visit. Yet it took me three EclipseCons until I finally visited it in 2009 for the first time. I may need to find a new event in that area. ;)  Anyway, I’ll give one of the many tutorials there (Dynamic Server Applications with EclipseRT).

JAX (April 16-20, Mainz, Germany)

Also bit of a classic, I like that event. It’s packed with lots of sessions and people. I’ll talk about developing cloud applications with Eclipse Gyrex. Our first major version (1.0) is only weeks away and that talk will be a great opportunity to learn more about Gyrex and see how we use it to solve some interesting problems.

Hope to see you soon at any of the events!

January 19, 2012

Do you know where ‘Go To…’ can get you?

How often do you use ‘Go To Class/File/Symbol’ feature in IntelliJ IDEA? Pretty often I would guess. But do you know everything you can do with it? Let me go through a couple of often overlooked gems.

Do you know that when you search for file or class you can preview an image (Ctrl-Shift-I) or see a quick doc (Ctrl-Q)?

It is also possible to open multiple items in the editor (multiselect with Ctrl or Shift) or run multiple selected tests right from the search (Ctrl-Shift-F10).

And you can open all search results in the ‘Find’ tool-window to process them one by one later.

Did I mention your favorite feature? No? Please, share it with everyone! :)

January 17, 2012

How to make money with mobile apps

As director of global marketing at mobile ad network InMobi, Gregory Kennedy has learned a thing or two about helping developers make money with mobile apps. In this Q&A, Gregory offers some advice for app developers of all platforms.

What’s the key to success as a mobile developer?

[Gregory] Focus on providing customers a great value proposition. If you’re making games, they need to take maximum advantage of the mobile experience. Angry Birds is the best example of this. The gameplay is simple and you only need a few minutes to play to the next level. It’s ideal for mobile. Sustaining success in digital media is more challenging, we’ve seen huge companies rise and fall in only a few short years. Being flexible enough to evolve is key, but you also need to develop a strong sense of what works in digital and stick to it.

Once you have an idea that works, then what? How do you turn that into profit?

There are four—and only four—ways to make money with apps.  The most obvious is through paid downloads, in which you set a fixed price for your app, customers purchase it, and the transaction usually ends there.  You could also seek an exclusive sponsor for your app.  It’s not the most economically sustainable method of monetizing, but it might help you establish yourself enough to make your next app a success.  Then, there are the increasingly prominent in-app purchases, in which your customer might not have to pay anything at the beginning (”freemium”), but will have the opportunity to make purchases within the app to enhance the experience.

[Read: Survey says: Mobile gamers prefer free games that are full of fertilizer]

And finally, you can sell advertising space within your app. Provided you have a good match between app and advertiser and an installed base large enough to support the volume of impressions needed for profit, this can actually make you more money than you can with a pay-per-download model. I always recommend developers mix and match models to their particular app business. The more monetization strategies you can employ, the more money you will earn.

What about marketing?

With over one Million apps in the world, competition is fierce. You can have the greatest app in the world, but if you can’t get the word out about it, nobody’s going to download it.

Should I worry about piracy?

If you’re developing apps for iOS only, you won’t really need to worry about it. Apple is committed to copyright and has done a good job at protecting the eco-system.  But of course Apple isn’t the only player in the game, and piracy is becoming an issue with Android apps.  Here at InMobi, we’re actually working on a technology that will still display ads in pirated apps, so that you continue to make money from your advertisers.

If you don’t develop for Android you’re missing out on a huge segment of the market. In a recent Mobile Insights Report, which covered August through October of 2011, we found that 31.1% of mobile ads were displayed on an Android device. Piracy is also not an issue if you focus on ad supported apps. Plus, unlike iOS apps, Android apps are available through multiple stores worldwide, so your potential for exposure can actually be even greater.

Before joining InMobi you spent many years as an artist and creative director. Why did you transition to high-tech marketing?

I was always good at that strategy and concept aspect of advertising. I found my clients responding positively, so after a while it just made sense for me to go onto the business side full-time.  I like to jokingly say that a good creative director is 85% marketing manager, 10% high school principal, and 5% creative. When I transitioned, I only had to give up that 5%.

January 16, 2012

IntelliJ IDEA’s Move Refactoring for ActionScript/Flex gets Smarter

At JetBrains we not only bring you new powerful features that make your life better, but also take care to polish the good old stuff to perfection. Let’s take a look at the Move refactoring for ActionScript classes, Flex components and all other types of top-level declarations (namespaces, functions, variables and constants), that has just got a little smarter. By the way, this refactoring also works for inner declarations (also known as helpers or file-local declarations), defined in ActionScript file out of the package statement.

Generally speaking there’s nothing special about Move refactoring, but in complex multi-module projects choosing a right folder may turn out harder than it seems to be. Well, not anymore it isn’t, and here’s the proof.

We’ll start with, invoking Move action by pressing F6 in editor, Project view or UML diagram (don’t forget to select your class/top-level function/whatever else first):

Here we specify the target package (thinking in terms of packages instead of directories is a lot more natural, isn’t it?). As we type, IntelliJ IDEA assists us with completion and highlights packages that don’t exist with red, which means they will be created on-the-fly, which is good, because we can start coding right away without preparing package structure in advance.

We can opt to searching for out-of-the-code usages (e.g. comments, string constants and properties files), and finally, if we need to move a class to a different source folder (e.g. to another module), all we need to to is to select an appropriate option! This way, after pressing Refactor or Preview we’ll be able to choose which module and source root to move to (current source root will be preselected):

And that’s it! No need to bother with directories anymore!

Of course, all changes can be previewed first, so that we can see the entire picture without making any actual changes, which is cool, because not all changes are safe. Press Preview and here we go:

All the usages of moved element grouped by type and location, plus we can easily exclude usages we don’t want modified.

Another interesting case is to move inner class to the top-level. This may be useful when some utility class has grown enough to deserve a separate file. Here’s an example:

Just as before, place the caret at the class and press F6:

Now accept the name and package of a new top-level class, and IntelliJ IDEA will take care about the rest.

We wish you safe refactoring, and keep watching this blog for the latest news!

January 12, 2012

Play! Console in IntelliJ IDEA

Did you know that IntelliJ IDEA 11 provides an integrated Play Framework console?

Start it from “Tools” menu, complete Play! commands, use command history, analyze output.
Play! with pleasure!

January 11, 2012

Profiling CPU in Flash and Flex Applications in IntelliJ IDEA

Hello guys! Just recently we’ve published an update to our Flash/Flex Profiler plugin that gives you a powerful and easy to use toolset for profiling of Flash-based applications in IntelliJ IDEA.

Let us give you a brief overview of what you can do with it.

Sure, the first thing to start with is installation. Nothing complex here—go to File menu, open Settings, then click Plugins and Browse repositories (if you’re on Mac OS, the path is slightly different—you should look in IntelliJ IDEA, then Preferences, Plugins, and then Browse repositories). After you’re there, find ActionScript Profiler and install it.

Let’s play with this extremely simple Flex component to set an example.

As you can see, it’s a rather heavy computation implemented in Task.calculateResult() method that is invoked 1000 times in a cycle from clickHandler() function that handles the mouse click.

To start the profiling we open context menu for the main class and click Profile:

Once the application is built and started, an empty Profiling window opens. Let’s tell profiler to start collecting CPU usage data by clicking Start CPU Profiling.

Now switch to our application, click Calculate and wait for resulting popup to appear. Then, we need to go back to IDE and click Stop CPU Profiling to compute the results—and here they are!

Invoked functions table shows the list of called functions, with child nodes representing points from which parent node was called:

We can easily compare timings by sorting the table by self time or cumulative time (just click column header for that).

Note: Edit source action is available for every item either via context menu or with F4 keyboard shortcut, so you can go to source code directly from profiling results.

Merged callees table at the bottom shows all the functions that were called (directly or indirectly) from the function selected in the upper table. You can sort this table as well to compare every detail and expand items to drill down through the call chains.

This concludes today’s post about CPU profiling. We hope you enjoyed it. In the next posts we are going to take a look at memory profiling capabilities and memory leaks hunting techniques. Please report any problems to the bug tracker. Stay tuned!

Plugin is compatible with IntelliJ IDEA 11.0 and 10.5. It was tested with 32-bit Flash Player 9, 10 and 11 on Windows (32- and 64-bit), Mac OS (32-bit and 64-bit) and Linux (32-bit).

Profile with pleasure!

January 05, 2012

Authentication changes at Eclipse.org

As you may have heard, we've changed our authentication scheme at Eclipse.org. Instead of having Committer accounts in one database and Bugzilla users in another, both of those databases have been brought together.

We did this for many reasons: it felt strange to ask users to create a "Bugzilla" account to be able to participate on Forums; it was confusing; our sites, such as Wiki and Marketplace, needed to keep track of two auth sources; Eclipse Committers essentially had two accounts, which made no sense; for every new software tool we'd install, we needed to write custom plugins to allow authentication against the Bugzilla database.

Now everything is consolidated, and although we don't have a complete Single Sign On solution, this change has paved the way towards that. It was also a required change in order to deploy the Gerrit code review system.

As with any migration, it wasn't without its bumps and glitches, but overall it went well. Thanks to everyone who tested, re-tested and wrote in to report problems and bugs.

January 02, 2012

Happy New Year, Out with the Old One.

Surprise! I haven't blogged in a long time (except for the blurbs about the EclipseCon 2012 program, which has turned out great, BTW). There's probably a few good reasons why I haven't spent much time here. The main one, I guess, to quote poor Flyers goaltender Ilya Bryzgalov, I've been a bit "lost in the woods" myself. But like him, that's more a state of mind than fact. And for 2012, I see a few paths that will lead me out of this cloud (or into one which would be one of the paths :).

We lost a lot of great people last year. I'm not sure if it's just my perception because of what happened in my life, but it seems more than usual. For me, it was the loss of my Dad to cancer after a year long battle. He inspired me to live my life with honour and respect for everyone, something which I try to do a lot in my work as the CDT project lead. Communities built based on respect and openness to all comers is the key to success.

Of course, there was Steve Jobs. My wife got me his biography for Christmas and I finished it a couple of days ago. The parallels in his physical condition with my Dad's was amazing. While Steve waited too long to get treatment, my Dad waited too long to get diagnosed and both ended up with their cancer metastasized to their livers which brought about their end. Dad was pretty weak at the end, couldn't eat due to the morphine, but he made one last trip to my dear cousin's wedding where everyone got to see him one last time. Steve was the same and had his last trip to resign as Apple's CEO and had a nice chance to say goodbye. All in all, it's a lesson to take care of yourselves. Treatments are getting pretty good but you got to catch it and act early.

As for Jobs' life and times, I'll dedicate a whole blog article on that. Reading the book was pretty eye opening. I learned a lot about how he really operated and the true reason for his success. And I also got a look into the history and life in Silicon Valley which you don't learn much out here in the wilderness other than the occasional visit. One thing is for sure, I'm pretty sure that life has passed me by and I only regret it a little :).

There were other famous people that passed. Dennis Ritchie being the foremost for me. He doesn't get enough credit for the changes he brought to our industry. Yes, he invented C and helped create Unix, but more importantly, those technologies let average programmers in on the action. Unix machines have always been everywhere and accessible and with their built-in C compiler, you just needed an account to join in on the fun. It's where most of my generation started and why I'm so passionate about the CDT and enabling new generations to learn how to play with fire.

Well, let's stop there for now. I have a lot more to write about and have a new found energy to write about it. I'm hoping this year will be a much better year for me and a great year for you all. Expect to see more in this spot than you have in a long time.

:D

December 30, 2011

IntelliJ IDEA 11.0.1

What could be a better way for the IntelliJ IDEA team to conclude the year 2011 than to release a bugfix update? And that’s exactly what we’re doing.

To upgrade to the new version, simply use the “Check for Update” action if you’re already running version 11, or grab the complete installer from the download page. And of course, the release notes for the new build are also available.

Happy New Year, and see you again in 2012!

December 29, 2011

Favorites tool-window in IntelliJ IDEA 11

When working with big projects we always come back to 10-20 items/files where we do the most of our work.

IntelliJ IDEA helps you collecting all these items in one place — ‘Favorites’. It’s easy to add a file, a class or a method to the Favorites by simply pressing Alt+Shift+F. You can also drag and drop items to the Favorites.

And now with ‘Favorites’ being a separate tool-window, just press Alt+2 (or Cmd+2) whenever you need to access one of your precious items again.

December 28, 2011

Create FlexUnit Tests Quickly in IntelliJ IDEA

Do you know how to navigate from a class to its test and back again or how to create a FlexUnit test quickly with IntelliJ IDEA 11? Let me tell you.

First of all make sure that flexunit.swc is within your module dependencies:

and just press Ctrl+Shift+T (Cmd+Shift+T on Mac) or select Navigate | Test from main menu:

Options to generate setUp() and tearDown() as well as test method stubs are available in test creation dialog:

And here you are!

Adding more tests is easy as well. Press Alt+Insert (Ctrl+Enter on Mac) and select to generate test method:

Hint: To be sure that test classes and FlexUnit classes won’t occasionally appear in production SWF/SWC follow these two good style suggestions:

  • configure dependency on FlexUnit library with ‘Test’ scope (as shown on the first screenshot)
  • keep test classes in a separate source folder marked as test source folder:

Test with pleasure!

December 27, 2011

IntelliJ IDEA for Spring Integration 2.0 Patterns

Spring Integration extends Spring to support the well-known Enterprise Integration Patterns via lightweight messaging within Spring-based applications and supports integration with external systems via declarative adapters.

Just wanted to let you know that in IntelliJ IDEA 11 we’ve added support for all 21 integration schemes with code analysis, completion, usages search and basic refactorings.

December 22, 2011

JavaFX 2.0.2 supports interoperability with the Standard Widget Toolkit (SWT)

JavaFX 2.0.2 includes support for SWT!

Eclipse and Eclipse RCP developers can now mix and match SWT and JavaFX, which means that SWT developers can now access the advanced graphics capability provided by JavaFX. SWT and JavaFX share the same apartment threading model seamlessly, so applications just work. The two toolkits can call each other directly, cooperating to show data to the user. I see an interesting future where SWT is used for the native trimming, task bar, alert boxes and other aspects of deep integration, while JavaFX is used to display advanced content.

You can see the API documentation at
http://docs.oracle.com/javafx/2.0/api/index.html

Look for the javafx.embed.swt package.

See also Richard Bair's blog on SWT at
http://fxexperience.com/2011/12/swt-interop/

Steve Northover

December 13, 2011

iOS beating Android for developer mindshare, says Flurry

“Developers, developers, developers”. Steve Ballmer said it in 2006, and it’s even more true today.

Nobody will use those fancy phones and tablets unless they have lots of great apps, and developers are the ones that create the apps. With a few exceptions, apps normally run on a single platform, so developers have to decide (sometimes well in advance of release) which platforms to target. Guess what attracts developers to one platform over another?

Money.

And according to mobile analytics company Flurry, iOS is winning the money game so far this year:

“Anecdotally, developers consistently tell us that they make more money on iOS, about three to four times as much.  To be sure, we pulled a sample of in-app purchase data from a set of top apps with versions on both iOS and Android, comprising of several million daily active users (DAUs). Running the numbers, we find that, on average, for every $1.00 generated on iOS, the same app will generate $0.24 on Android.”

In the 3rd quarter 2011, Flurry reports that new project starts on iOS outnumbered project starts on Android by a 3 to 1 margin. They place the blame squarely on Google for not making it easier for Android users to spend money in the Market:

“The largest single factor that appears to impact developer support for the platform is the consumer’s ability to pay.  This comes down to Google Checkout penetration.  Upon setting up an iOS device, a consumer must associate either a credit or gift card to her iTunes account.  In theory, this means that 100% of all iOS device users are payment enabled.  This has not been the case for Android, resulting in lower revenue generation possibilities on the platform.”

I think the Amazon Appstore is poised to take everybody by surprise and become a real revenue generator for Android developers. Ideally, we’d just have one app store, but with Google’s missteps with the Google Market and their witholding of the Market from unapproved devices, they’ve left the door open for competitors. Flurry, though, is optimistic Google will step up to the plate:

“With the recent integration of Google Wallet and Google Checkout, as well as their current $0.10 Android app sale to spur new account sign-ups, Google appears to be taking steps to correct this.”

We’ll see. Lately Google’s emphasis has been on everything but apps, in particular Books, Videos, and Music. These are all things that Amazon is good at (especially the first two) and I’m highly skeptical Google can take a significant share away from them. Perhaps it’s time for Google to team up with Amazon, let Amazon run the Market and let Google concentrate on their core competencies: providing the enabling technology (Android), searches, voice, ads, and ad networks.

December 12, 2011

New Docs with JavaFX 2.0.2

<IMG SRC="http://docs.oracle.com/javafx/javafx/images/javafx-documentation.png"> <p>New information has been added to the documentation for the JavaFX 2.0.2 update:</p> <ul> <li><p><a href="http://docs.oracle.com/javafx/2.0/charts/css-styles.htm">Styling Charts with CSS</a> describes how to alter the visual appearance of charts in your application. Using the various CSS classes and properties you can set an alternative color scheme, add images and graphical effects, modify the chart legend and plot, and even invent new chart symbols.</p></li> <li><p>The <a href="http://docs.oracle.com/javafx/2.0/ui_controls/menu_controls.htm">Menu</a> chapter of the JavaFX UI Controls tutorial describes how to build a menu bar in your application, add menu items, assign specific actions to each item, and set a context menu for a node.</p></li> <li><p><a href="http://docs.oracle.com/javafx/2.0/events/jfxpub-events.htm">Handling JavaFX Events</a> describes how to create and use event handlers and event filters to process user interactions with your application.</p></li> <li><p><a href="http://docs.oracle.com/javafx/2.0/doclet/jfxpub-doclet.htm">Using a Doclet with JavaFX</a> describes how to use the Javadoc doclet that was created for use with JavaFX source code. Using the doclet with the Javadoc tool produces customized HTML documentation.</p></li> <li><p><a href="http://docs.oracle.com/javafx/2.0/deployment/jfxpub-deployment.htm">Deploying JavaFX Applications</a> describes a new JavaFX Ant helper parameter, <a href="http://docs.oracle.com/javafx/2.0/deployment/javafx_ant_task_reference002.htm#CACIJFHB">&lt;fx:argument&gt;</a>. Also new is a mechanism for passing images to the &lt;fx:deploy&gt; task. Use <a href="http://docs.oracle.com/javafx/2.0/deployment/javafx_ant_task_reference002.htm#CACFJBFJ">&lt;fx:icon&gt;</a> to pass icons for various purposes or <a href="http://docs.oracle.com/javafx/2.0/deployment/javafx_ant_task_reference002.htm#CACDIDFE">&lt;fx:splash&gt;</a> to pass a splash screen image for Web Start applications.</p></li> </ul> <p>Starting with Java SE 7 Update 2, the JavaFX SDK is bundled with the JDK. <a href="http://docs.oracle.com/javafx/2.0/installation/jfxpub-installation.htm">Installing JavaFX</a> provides information on installing the JDK that includes the JavaFX SDK as well as information on installng the standalone JavaFX SDK. </p> <p>Any doc that includes a NetBeans project has been updated with a new NetBeans project due to changes in the project format between NetBeans IDE 7.1 Beta and NetBeans IDE 7.1. The new projects require NetBeans IDE 7.1.</p> <p>You can download JavaFX 2.0.2 from <a href="http://www.oracle.com/technetwork/java/javafx/downloads/index-jsp-136193.html">OTN</a>. For all tutorials and API documentation, see <a href="http://docs.oracle.com/javafx">http://docs.oracle.com/javafx</a>.</p>

December 11, 2011

Where is Eclipse 3.8 M4?

Just wondering if anyone knows why is there no Eclipse 3.8 M4 build on the http://download.eclipse.org/eclipse/downloads/eclipse3x.php page? Eclipse 4.2 M4 is already there: http://download.eclipse.org/eclipse/downloads/ (but right now I can't use it for the daily work due different UI bugs).

Is it just a small build problem or a strategy change (3.8 were expected to be released together with 4.2)?

December 04, 2011

JFreeChart 1.0.14 - New Features II

Another key feature in the JFreeChart 1.0.14 release is the option to render drop-shadows within plots, aimed at charts that will be rendered on-screen. The effect of this is quite subtle, but noticeable if you compare two charts directly, one with the shadows and one without:

Compare this to the same chart generated without the drop shadow:

I had resisted adding this feature in the past, because it means dropping down to bit-map level operations, and the rest of JFreeChart is based purely on vector primitives...but in the end, there were too many people that wanted this and, like most things in JFreeChart, the developer can configure it however he or she prefers.

Utilising this feature will incur some overhead in memory usage, but is very simple to switch on - simply add the following line near the start of your application (before any charts are created):

ChartFactory.setChartTheme(new StandardChartTheme("JFree/Shadow", true));

There are other more direct ways as well, for example see the setShadowGenerator() method in the XYPlot class.

November 27, 2011

JFreeChart 1.0.14 - New Features I

Over the coming weeks, I aim to post a few entries highlighting some of the new features in JFreeChart 1.0.14. I hope also that the examples (there will be source code) will encourage developers to experiment with the multitude of settings in JFreeChart to customise the appearance of their charts. It is a common (and fair) criticism that the default "look" in JFreeChart is dated (some even say ugly but they are not very polite)...but with a few calls to the right API methods, you can radically change the resulting output.

I'll start with the new support for Java's RadialGradientPaint in pie charts, which gives an opportunity for developers to liven up the appearance of these charts with only a small amount of additional effort (you need Java 6 or later for this to work, since RadialGradientPaint does not exist in earlier Java runtimes). You can simply call the existing setSectionPaint() method of the PiePlot class and pass it a RadialGradientPaint instance, as the following example illustrates:

Here is the corresponding source code:

/* -----------------
 * PieChartDemo.java
 * -----------------
 * (C) Copyright 2011, by Object Refinery Limited.
 */

package demo;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Point;
import java.awt.RadialGradientPaint;
import java.awt.geom.Point2D;

import javax.swing.JPanel;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.StandardChartTheme;
import org.jfree.chart.plot.PiePlot;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.general.PieDataset;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.HorizontalAlignment;
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.RectangleInsets;
import org.jfree.ui.RefineryUtilities;

/**
 * A demo for a pie chart using RadialGradientPaint in JFreeChart 1.0.14.
 */
public class PieChartDemo extends ApplicationFrame {

    private static final long serialVersionUID = 1L;

    {
        // set a theme using the new shadow generator feature available in
        // 1.0.14 - for backwards compatibility it is not enabled by default
        ChartFactory.setChartTheme(new StandardChartTheme("JFree/Shadow",
                true));
    }

    /**
     * Default constructor.
     *
     * @param title  the frame title.
     */
    public PieChartDemo(String title) {
        super(title);
        setContentPane(createDemoPanel());
    }

    /**
     * Creates a sample dataset.
     * 
     * Source: http://www.bbc.co.uk/news/business-15489523
     *
     * @return A sample dataset.
     */
    private static PieDataset createDataset() {
        DefaultPieDataset dataset = new DefaultPieDataset();
        dataset.setValue("Samsung", new Double(27.8));
        dataset.setValue("Others", new Double(55.3));
        dataset.setValue("Nokia", new Double(16.8));
        dataset.setValue("Apple", new Double(17.1));
        return dataset;
    }

    /**
     * Creates a chart.
     *
     * @param dataset  the dataset.
     *
     * @return A chart.
     */
    private static JFreeChart createChart(PieDataset dataset) {

        JFreeChart chart = ChartFactory.createPieChart(
            "Smart Phones Manufactured / Q3 2011",  // chart title
            dataset,            // data
            false,              // no legend
            true,               // tooltips
            false               // no URL generation
        );

        // set a custom background for the chart
        chart.setBackgroundPaint(new GradientPaint(new Point(0, 0), 
                new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));

        // customise the title position and font
        TextTitle t = chart.getTitle();
        t.setHorizontalAlignment(HorizontalAlignment.LEFT);
        t.setPaint(new Color(240, 240, 240));
        t.setFont(new Font("Arial", Font.BOLD, 26));

        PiePlot plot = (PiePlot) chart.getPlot();
       
        plot.setBackgroundPaint(null);
        plot.setOutlineVisible(false);

        // use gradients and white borders for the section colours
        plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
        plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
        plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
        plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
        plot.setBaseSectionOutlinePaint(Color.WHITE);
        plot.setSectionOutlinesVisible(true);
        plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));

        // customise the section label appearance
        plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
        plot.setLabelLinkPaint(Color.WHITE);
        plot.setLabelLinkStroke(new BasicStroke(2.0f));
        plot.setLabelOutlineStroke(null);
        plot.setLabelPaint(Color.WHITE);
        plot.setLabelBackgroundPaint(null);
        
        // add a subtitle giving the data source
        TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523", 
                new Font("Courier New", Font.PLAIN, 12));
        source.setPaint(Color.WHITE);
        source.setPosition(RectangleEdge.BOTTOM);
        source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        chart.addSubtitle(source);
        return chart;

    }

    /**
     * A utility method for creating gradient paints.
     * 
     * @param c1  color 1.
     * @param c2  color 2.
     * 
     * @return A radial gradient paint.
     */
    private static RadialGradientPaint createGradientPaint(Color c1, Color c2) {
        Point2D center = new Point2D.Float(0, 0);
        float radius = 200;
        float[] dist = {0.0f, 1.0f};
        return new RadialGradientPaint(center, radius, dist,
                new Color[] {c1, c2});
    }

    /**
     * Creates a panel for the demo (used by SuperDemo.java).
     *
     * @return A panel.
     */
    public static JPanel createDemoPanel() {
        JFreeChart chart = createChart(createDataset());
        chart.setPadding(new RectangleInsets(4, 8, 2, 2));
        ChartPanel panel = new ChartPanel(chart);
        panel.setMouseWheelEnabled(true);
        panel.setPreferredSize(new Dimension(600, 300));
        return panel;
    }

    /**
     * Starting point for the demonstration application.
     *
     * @param args  ignored.
     */
    public static void main(String[] args) {

        // ******************************************************************
        //  More than 150 demo applications are included with the JFreeChart
        //  Developer Guide...for more information, see:
        //
        //  >   http://www.object-refinery.com/jfreechart/guide.html
        //
        // ******************************************************************

        PieChartDemo demo = new PieChartDemo("JFreeChart: Pie Chart Demo 1");
        demo.pack();
        RefineryUtilities.centerFrameOnScreen(demo);
        demo.setVisible(true);
    }

}

November 25, 2011

Meeting the people is what this is all about

I attended the Ottawa DemoCamp yesterday, where a bunch of Ottawa Eclipse community members gathered for a bit of food, a bit of beer and a lot of cake to celebrate Eclipse's 10th birthday.

These informal gatherings are not only about food, beer (and cake) and idle chat -- there is some quality learning happening at these events, and a great opportunity to meet some interesting people.

Yesterday I made some new friends who work on Eclipse technologies for the federal government of Canada right here in Ottawa. The Department of National Defense, no less (yes, Canada has one of those).

I also had a short but interesting talk with Ken Hussey about his work on Puppet-related tools at Cloudsmith. I've had Puppet on my list of tools to investigate for quite some time now, and seeing Cloudsmith in that space may help precipitate things.

A gentleman named Antoine also talked to me about Sonar -- a code quality and analysis platform. He made it sound really good, and the screenshots make it look even better. Definitely on the radar.

Ericsson was also in the house, and I had a short conversation with someone whose name I unfortunately cannot remember. But she was very nice, and explained that they use Eclipse and the CDT. I wanted to introduce her to Mr. CDT ("I pity the fool") himself, since he was also present yesterday -- but alas, that never happened.

Lastly, being seen in public with such local celebrities as Kim Moir, John Arthorne and Pascal Rapicault is always a great way to boost one's image.

Cheers!

November 16, 2011

EclipseCon 2012 Early Bird and Looming Deadline

We've had a really good first round of submissions and I have to admit I was overwhelmed by the number that we received. It was awesome and thanks to those who've already submitted. Of course there's always need for more and you have until Friday night to get them in. There are still a few gaps that need to be filled, like tutorials, and we're always interested in new things we haven't thought about.

To highlight the kind of talks we like, we've selected 5 early bird sessions. We're big on technical talks since that's what we hear you want to see most. We're also very interested in talks that help us think about our community and ways of working better with them and achieving growth. Here's the golden five. Only a hundred or so more to go :).
We're looking forward to additional great talks we'll see in the submission system. Get yours in today!

November 15, 2011

Crowdsourced translations make Eclipse in English better too

A few years ago I actively worked on the Babel project -- a crowdsourced solution to Eclipse globalization. Since then the translation tool has been doing its job -- allowing the community to contribute translated strings, which are then turned into downloadable language packs.

Lately, one of our contributors in Japan has been opening a series of bugs outlining issues with the English strings in the message files. Pure awesome.

You have to love the power of OSS -- the more eyes we have looking at code, the better it becomes.

November 02, 2011

My first EclipseCon Europe!

I'm in Germany this week for my first EclipseCon Europe. I had heard rumors that the Wifi's performance wasn't comparable to that of EclipseCon NA so I came here to help.

Just to be clear: I'm not involved in the network or Wifi setup at either conference, but I do bring a copy of download.eclipse.org with me. I then set up a mirror and some redirects so that your Eclipse bits aren't sent over the Internet.

This morning was a typical EclipseCon Day 1: although the conference Wifi is great, as attendees start up Eclipse, the p2 downloads pile up against the poor Internet connection, making it nearly impossible to do anything else. But after some caches, redirects and tweaking compression on www.eclipsecon.org, the local mirror is putting out over 800KB/sec and the rest of the world feels accessible again.

I'll keep monitoring the situation throughout the conference and tweak content as I can to help make sure your Wifi experience at econ2011 is the best it can be.

October 28, 2011

10 years of Eclipse as seen by /etc/passwd

If you've worked on a *nix system, you're likely familiar with the /etc/passwd file -- the main list of accounts on that system. Although eclipse.org does not use the passwd file for user accounts, examining the compatible getent passwd tells the story about who was involved in setting up the original dev.eclipse.org way back in 2001.

Keep in mind that we delete accounts of committers who have been completely decommitterized; therefore, the people you see mentioned below are still active participants in the Eclipse community even after 10 years.

First up, the standard root, mysql and other system accounts, then here's what I see:

500:kmoir


I wasn't there in 2001, but judging by her UID=500, I'm guessing Kim Moir was the one who inserted the first Linux CD in the drive and installed a computer called "dev.eclipse.org".

Next up:
512:mmartin

Mark was a webmaster@eclipse.org for a long time. Although he and his account are no longer active on dev.eclipse.org, he gave me my webmaster training at the IBM Queensview lab back in October 2004. So his account stays for my own nostalgia :-)

Judging by Mark's UID=512, I'm guessing a few other webmasters were blessed with accounts on dev.eclipse.org before his.

Next up:
1000:droy
1002:jeff

I am an imposter in that list, since Jeff McAffer predates me by a few years. But I have root@eclipse.org, so I faked my UID=1000. Deal with it :-)

After creating Jeff's account, Kim wasted no time getting things set up:
7003:cvs
7004:viewcvs
7005:anonymous

The jump from UID=1000 to UID=7003 is likely an artifact of an IBM security policy for user ids, since there is nothing below 7003.

Then, we have the first Eclipse committers:
7008:pmulet
7012:mcq
7020:dj
7026:johna
7033:ggayed
7034:veronika
7036:steve
7037:silenio
7043:dmegert
7047:daudel
7048:jeromel
7050:oliviert

Although some of them are not very active anymore, some of them still are, but one thing they all have in common is that they helped shape Eclipse as you see it today.

Mailing lists on dev.eclipse.org came a bit later in 2002 with the creation of a 'mailman' account, followed shortly by a 'webmaster' account. At that time, I'm guessing the real webmaster became a few people who perhaps occasionally shared the job.

7336:david_williams

David Williams and some of the still-active WTP committers are listed next, which likely happened in 2003-2004 when the WTP top-level project was created. Today, David Williams is a name recognized more than even Eclipse itself.

A bunch of BIRT committers are listed in succession, which matches up to 2004's creation of the top-level project of the same name.

8249:mmilinkovich

Although Mike was on the Eclipse scene long before I was, he only got an account on dev.eclipse.org when the Phoenix project was created and he became a committer. Bye Bye Frames!

The Eclipse superstar with the most letter Z's in his name... circa 2005 ... followed by our own Conference Queen Anne Jacko.
8444:caniszczyk
8636:ajacko

I could go on... But I wanted to highlight the first years. Besides, I must be the only sysadmin dumb enough to put user id's and UIDs in plain text on a blog.

Fast forward six years... and we're up to UID=9826. Who will have lucky account UID=10000 ?

October 19, 2011

Hudson building Hudson


Ok, so I'm easily impressed. I think it's cool.

October 03, 2011

30.8 Terabytes!

Last month, Eclipse.org servers have moved 30.8 TB of data to the Internet. 30.8 Terabytes! That is a first -- even during the yearly release, we've never moved so many bits in one month. And September was a short month :)


It's been a steady climb since we started tracking bits in 2006, but it appears that since early 2010, things have really taken off like a rocket.

So I decided to compare our monthly bit throughput with the size, on disk, of the Eclipse code repos.

Code size is increasing quite linearly, with a noticeable boost in size midway though 2009.

Next up is the same bit throughput and SCM size on disk, compared to our binary downloads footprint.



As we prepare for Eclipse's 10th anniversary next month, these numbers show that there's no slowing down the momentum that Eclipse has gained during that time. Cool stuff!

September 26, 2011

Jersey Micro Benchmarking Framework

A micro benchmarking framework has been created for Jersey/JAX-RS. This allows us to do continuous performance testing using hudson to make sure Jersey keeps performing well as we are adding functionality.  This test suite also allows us to test between different JAX-RS versions, which helps us catch any regressions in Jersey 2, with respect to Jersey 1. 

I am testing basic functionality such as media type to java type conversions, and vice-versa.  I am testing the most commonly used media types. MediaType conversions covered in testing baseline results include:

  • XML
  • JSON
  • Strings
  • InputStream

Not only is there added support for different payloads, XML, pure text, JSON payload, but I am also testing:

  •  HTTP methods + JAXRS annotations GET, PUT, POST, DELETE. 
  •  annotations like @QueryParam, etc.

I can increase our testing coverage, testing various features, as required.

I am utilizing Japex Micro-benchmark Framework to implement our testing suite. Japex includes a Maven2 plugin, which we use to run microbenchmarks from our maven build.   Hudson includes a Japex plugin to allow Japex Trend reports to be displayed within hudson.  Here is a snapshot of Japex Trend report for JUnit testing of  sample Root Element Collection method:

Japex Trend Report for Root Element Collection test

I'm trying to ensure that we eliminate "noise" from these performance number results.  Initially the numbers were less stable, as there were multiple executors configured on hudson slave, allowing multiple jobs to run concurrently. That has been changed to now run single executor on hudson slave where micro benchmark tests are run. Also, I have analyzed hudson slave to ensure no cron jobs are triggered during performance testing. This is a work in progress, striving for more deterministic results moving forward.

I've configured the Japex hudson plugin to notify us when there is more than a 1% change in performance via the configure page of our hudson job:

Japex Hudson plugin Config screenshot

The usage of Hudson with Japex allows us to continuously monitor the performance of Jersey as it moves forward. 

Special thanks to Santiago and Jakub for their help in putting the pieces together.

September 23, 2011

Going to EclipseCon Europe: is there enough beer in Germany?

In the years past, I was told I could not attend EclipseCon Europe because there wasn't enough beer in Germany to satisfy this thirsty Canadian. I'm not sure how much truth there is to that, but it's what I was told.

Anyway, as the European edition of my favourite gathering has grown, so has the need for some official IT support. I'll be flying in Tuesday, Nov. 1 to help (however I can) with WiFi setup and to set up a download mirror like I do at EclipseCon North America. The download mirror is a real Internet saver -- these conference venues typically don't have tons of Internet bandwidth, so bringing a local copy of all your favourite Eclipse bits helps a lot. I look forward to seeing all my European friends, and to making some new ones!

In the interest of saving thousands of dollars in airline fees, I'll be staying over Saturday for some local sightseeing. Since this will be my first time in Germany, if you have any hints as to what I should do during my stay, please post up in the comments.

Edit 9/23: Apparently comments were disabled on my blog. Sorry 'bout that.

August 03, 2011

Debugging Eclipse Indigo plugins on OSX

I do not why this took me so long to figure out, but I have been having a problem with Indigo that whenever I fire up the Eclipse Runtime workbench to debug a plugin it would crash almost immediately. At first, I thought it had something to do with my plugins, but eventually I took the time to do a clean install without any of my plugins and saw the problem just by creating a simple demo project in the runtime. Since I already had a working Helios installation, I just shrugged and went back to using that for now and set the problem aside.

Well, last week I got a new Macbook Air with Lion preinstalled and so I am setting up a new system from scratch. This time I only have Indigo installed and lo and behold I am still seeing the same problem. Realizing that there must be a simple explanation, I now looked closer and see that there is a simple explanation. For some reason, on Indigo when it Eclipse creates your default configuration it is not including the PermGen settings by default. So I was just crashing due to not enough PermGen space errors. Pretty obvious, it has just been a long time since I had seen these problems.

Adding "-XX:MaxPermSize=256m" to the -vm arguments in my Runtime Configuration has everything working great again.

June 21, 2011

Indigo early access to Friends of Eclipse

An email was sent out to the Friends of Eclipse, announcing early availability to the Indigo bits. Less than 2 minutes later, here is the resulting spike in usage on the Friends of Eclipse Mirror:



If you're a Friend, you can access the download links right now. If not, consider becoming a Friend today as part of the Indigo 500.

Torrent files are also up for early access to our p2p users.

June 09, 2011

We need cool screenshots of Eclipse

Have you looked at http://www.eclipse.org/screenshots/ lately?

Yes, it is old.

I was thinking that we could move that page to the Wiki (perhaps http://wiki.eclipse.org/Screenshots ?) so that everyone can submit cool-looking screenshots of Eclipse in action.

If you agree it's a good idea, I need your help to get started. If you create the wiki page and upload/post your Eclipse In Action screenshots, I'll set up redirects from the old page to the new page.


Anatomy of an outage - part II

Yesterday I posted about the first of two outages we've experienced last week. Today I'll post about the outage we had late in the early afternoon of June 2.


Similarly to our previous outage, we suddenly lost our ability to talk to our primary switch -- a Cisco 2970 24-port Gigabit switch, in service since October 2004.

We feared the worst -- a tripped power circuit caused by a faulty power supply. Again? Not this time -- the switch was simply 'frozen' with an orange alert lamp. After cycling the power, we were back in business.

But why did it just freeze? Was it beginning to show signs of fatigue? Matt and I took no chances -- with enough available ports on our much newer 48-port Cisco 2960 (part of a hardware donation made by Cisco for EclipseCON 2009), we migrated all the connections off to the new switch.

Accurate graphs and documentation allowed us to migrate port settings, VLANs and QoS rules quickly to the 'new' switch.

June 08, 2011

Anatomy of an outage - part 1

It happens to Facebook. It happens to Hotmail. And yes, it happens to Eclipse. Last week Eclipse.org suffered two distinct outages. Today I'll discuss the first one "briefly".

From a bandwidth point-of-view, this is what a normal 24-hour period looks like.


This is what we saw on the morning May 31:I had just walked into the office when I discovered we were completely offline. Since the Foundation's Ottawa office is wired directly into the Eclipse.org switching gear, I was surprised to discover I couldn't even talk to our switches. So I hopped in my car and drove to the Data Center, which is about 10 minutes away.

Turns out a few servers were powered off, as was our main switch and firewall -- the circuit breaker had tripped. When the technician reset the circuit, sparks spewed out of a power supply in our DS4 raid array. Not good.

We pulled the faulty component, reset the breaker and restored power to the switch and firewall. "Problem Solved" I thought. Not so fast.

For reasons unknown, our primary NFS server (which hosts shared files for CVS, Git, SVN, and many of our websites) was frozen. I found that strange, since they do not share the same power circuit. Heck, they aren't even on the same voltage rating. This specific server doesn't normally output video, relying instead on a Hardware Management Console (HMC) to communicate with the operator.

As luck would have it, the HMC was one of the servers connected to the downed power circuit, and filesystem errors were preventing it from coming back online. So I had no insight as to what my faulty NFS server was doing, or why it was frozen.

After a bit of waddling and trying to restart it, I decided to abandon the primary NFS server, and notified fellow webmaster Matt to begin the failover process to the secondary server. That is when services began recovering, about 1h45 minutes later.

To this day, we still haven't figured out what is wrong with our primary NFS server, although Matt has fixed the HMC. And the DS4 storage box is still operating on only one power supply (although another is on order and is expected to arrive soon).

We've decided to begin the process of acquiring new NFS server hardware. The 'old' servers are big, complex machines that have been in service 24/7/365 for almost 7 years. They have served us well, but they are showing signs of age, as memory failures, disk failures and backup battery failures are manifesting themselves more frequently.

Stay tuned for some explanations on the other complete outage, that came upon us just days later...

April 28, 2011

Back to Oracle!

Summary: I’ve loved my last five years at the Eclipse Foundation. It’s time for me to move on. I’m going to Oracle to work on OpenJDK and other things.

The longer version:

It was over five years ago that I joined the Eclipse Foundation. I had just finished an MBA and was working at Oracle in a well regarded technical swat team in Java middleware. The Eclipse Foundation had launched in my hometown of Ottawa, and here I was, eager to learn about open source, the rapidly changing business model of enterprise software, ecosystems and to do something fresh. So I took advantage of this unique opportunity and convinced Mike that I should help run the Eclipse Foundation membership.

My 5+ years at Eclipse were incredibly rewarding both personally and professionally. I’ve made countless new friends and acquaintances from all the organizations that I’ve had the pleasure of working with. I was privileged to be working directly with many great thinkers in the software industry, and learning about how big ideas, like Eclipse, happen.

All the staff at the Eclipse Foundation that I’ve ever worked with have been high performing and maniacal about driving the Eclipse Ecosystem forward. I believe the Eclipse Foundation has done great things by helping hundreds of organizations keep pace with evolving business models and to make available a lot of high value free software. I leave the Eclipse Foundation with complete respect and admiration for every single person there. They do incredible things with limited resources and many constraints. I will continue to be a fierce advocate and supporter of all things Eclipse.

I believe strongly that we are at the beginning of a renaissance period for Java. Once again there is real investment and participation in Java. There is a roadmap that has an immediate impact with Java SE 7, and plans far into the future – with many organizations and stakeholders keen to see it happen. Moreover, I’m convinced that once a world class modularity solution becomes part of core Java, we will see even more and faster innovation. It means great things from the biggest cloud, to the smallest device.

I have a matching skill set to help Java evolve for the decade to come, so I decided to jump at an opportunity to join the Oracle Java SE team. I will be working with OpenJDK and other things. I am truly proud to be working with folks like Dalibor Topic, Henrik Staal, Mark Reinhold and Adam Messinger.

The team I’m on has one simple mandate – keep Java the number one computing platform in the world. Period. I start May 9th, and will post some pointers when I land.

- Don

April 26, 2011

I've been hacked!

I was hacked today (or at least I learned of it today). Early this AM a SPAM was sent from my GMail account to all of the Contacts in my GMail -- which I believe is any address I have ever received an email from. Given all of the mailing lists I am on, this is a decent number of addresses. Since the email was DKIM-verified to come from GMail and it went to all my contacts, I have to assume someone was able to successfully login to my GMail. I have since changed my password a couple times, and turned on the 2-factor authentication feature. I would highly recommend everyone do this with their Google account if they have not. I also changed my password on every site I can think of, just for safe measure.

How did this happen? I have no way to know for certain, but I have a theory. The Sony Playstation Network has been down for several days now due to some kind of attack. My username for PSN was my GMail account and I was stupid enough to use the same password (or at least they matched last week, I may have recycled back to it). I mainly use PS3 and PSN for Netflix streaming. I suspect that when the site was first down last week that intruders were intercepting logins and they got the username and password. My main reason to doubt this theory is that hacking PSN seemingly was sophisticated to do, so why would they use the information they stole in such an amateurish way as to send an obvious SPAM that alerted me to the problem? I have to think they downloaded all my email and information before they did this. I wonder why they did not also change my password as it seems like they could have done so.

It is fairly disconcerting to wonder what private information, such as credit card numbers, that I might have in my GMail archive. For now, I at least think I have safely updated all of my accounts so that the passwords are different on every site.

Update (2011-04-26): Sony has now pretty much confirmed that this all originated with the hack of PSN. See this blog post: http://blog.us.playstation.com/2011/04/26/update-on-playstation-network-and-qriocity/ Of course it was still stupid on my part to use my GMail password anywhere outside of GMail.

Eclipse Forums upgrade gone bad.

A few weeks ago I set out to upgrade our aging Forums software. We're about 1.5 years behind the latest release, and with numerous bugfixes and new features, an upgrade seemed compelling. For instance, here are some of the things we're missing:

  • Per-forum search. Because of the size of our forums (650,000+ messages), the single database server would be crushed by the search queries.
  • Single database server. The current version only supports a single server, limiting scalability and preventing us from enabling search.
  • Broken NNTP bridge. Our forums are linked to the NNTP newsgroups, and attachment import/export is broken, as are many extended character sets.

Despite my best efforts, the upgrade failed miserably and I reverted back to the old version. The software we use, FUDForum, is a decent piece of code, but it has a rather unorthodox way of doing templates and themes, which leads to it being easily broken on our rather restricted multi-server PHP environment. When I set it up almost 2 years ago, I had to twist and contort it to fit. The result was a brittle piece of software that did what it is supposed to, as long as you walked on eggshells when managing it.

On the bright side, a brand-new install of the same software works like a charm on eclipse.org, without any of the previous twisting and contorting needed, and it simply feels more robust. I guess 2 years of development will do that to software. There's just something with the upgrade process + our hacked version that simply doesn't jive.

All told, we cannot simply continue using the current version. It works, but with many broken parts, and with many security holes now patched, it needs fixing. I can think of two options:
  • Option 1: Move to a different forum software. This would break links to all the existing messages, present a new UI to our users and would put us webmasters in unfamiliar territory by discarding the two years of knowledge we've accumulated with FUDForum.

  • Option 2: Install the new version from scratch, and re-import all the NNTP messages. This would also break links to existing messages, but it is known to work on our servers, and FUDForum (although not perfect by any means) is now well understood by the webmasters.
What is your take? Feel free to discuss with us on bug 342708.

March 24, 2011

Announcing EclipseCon Europe 2011, and EclipseCon North America 2012 Program Chair

As I mentioned this morning at EclipseCon, we're proud to announce EclipseCon Europe, 2011. New name, but same great conference. We wanted to demonstrate the equal importance of both our major events, and decided to unify on the "EclipseCon" brand. Bernd Kolb will be reprising his role as Program Chair and we hope he makes great use of the extra space. We sold out early last year, so plan to register early to avoid disappointment!

Also, we'd like to announce Doug Schaefer (CDT Project Lead) as the Program Chair for EclipseCon North America 2012 (exact dates and location TBA). We've had an excellent run of great Program Chairs who put their own touch on EclipseCon and we're looking forward to Doug's perspective and leadership.

- Don

March 18, 2011

EclipseCon poll results

On Wednesday I asked you a few questions about your EclipseCon experience.. Here are the results:

39 this.is.my.first.eclipsecon.ever.its.going.to.be.great---they.say.you.buy.beers

Welcome to all the newcomers! Look for me at the bar and I'll buy you a beer *


36 please.set.up.a.better.404.page.for.eclipsecon

Popular option... Ask and you shall receive. Go look...


30 ive.been.to.many.eclipsecons---why-have-you-never-bought-me-a-beer

Sorry if I've missed you... Hopefully I'll do a better job this year *


27 ive.been.to.all.the.eclipsecons---and.I.know.you.buy.beers

Yes, I know who you are... Quite a costly bunch :)


25 ive.been.to.a.couple.of.eclipsecons---I-prefer-to-run-than-drink-beer

If running wasn't so early in the morning, I'd likely join you. I'll try this year -- I might actually make it a few feet.

Some other responses and comments I've received:

webmaster.not.going.this.year.will.miss.the.beers

That's really unfortunate -- there's always EclipseCon Europe, and EclipseCon 2012


webmaster.ive.never.been.at.eclipsecon---please-send-beer-to-france

I can't really send beer to France but here's what I can do: to the person who posted this, send me an email to webmaster@eclipse.org. If your IP address matches up to that comment in my Apache log, I'll send you some Eclipse SWAG!

webmaster.ive.been.to.all.the.eclipsecons---and.I.know.you.buy.beers----altough-thats-not-entirely-true----well-its-not-true-that-ive-been-to-all-eclipsecons-but-you-guys-always-bought-beers

I'm so confused :)

webmaster.i'd.buy.you.a.beer.if.i.were.going.but.unfortunately.i'm.not.(sad.smily)
webmaster.i.am.not.going.to.make.it--can-you-mail-me-the-beer?

It's too bad you can't come ... I hope to see you next year.


* Disclaimer: offer valid while supplies last, no rainchecks. On approved credit. Offer subject to change without notice. See newspaper for details. Professional driver on closed course, do not attempt. Viewer discretion is advised. Product may differ from illustration.

March 16, 2011

Is everyone ready for EclipseCON?

Only five days until the big event begins (well, four days, if you consider the conference to officially kick-off Sunday evening at the bar).

If you want to distribute large files (or many files) to fellow attendees, upload your files to download.eclipse.org ASAP, since download.eclipse.org will be mirrored at the conference centre in its entirety -- including Nightly builds.

As per the tradition, here's a whacky webmaster poll to scope out the conference newcomers and veterans. Please choose one of the following options -- results will be posted tomorrow:

http://eclipsecon.org/webmaster.this.is.my.first.eclipsecon.ever.its.going.to.be.great---they.say.you.buy.beers

http://eclipsecon.org/webmaster.ive.been.to.all.the.eclipsecons---and.I.know.you.buy.beers

http://eclipsecon.org/webmaster.ive.been.to.many.eclipsecons---why-have-you-never-bought-me-a-beer

http://eclipsecon.org/webmaster.ive.been.to.a.couple.of.eclipsecons---I-prefer-to-run-than-drink-beer

http://eclipsecon.org/webmaster.please.set.up.a.better.404.page.for.eclipsecon

March 02, 2011

GlassFish 3.1: using the master password and managing instances

GlassFish 3.1 supports creating and managing instances on multiple hosts from a central location (the DAS).

 

GlassFish 3.1 supports creating and managing instances on multiple hosts from a central location (the DAS). The server software uses SSH to communicate to the remote systems where the instances reside and Joe's blog contains useful information on setting up SSH in a way that GlassFish can take advantage.    In this blog I talk about managing those instances when the user sets the master password to something other than the default.

It is recommended that users change the default master password for security reasons.  Since GlassFish never transmits the master password or associated file over the network, the user must take action on the remote hosts to allow the system to manage the instances from a central location.  Commands such as start-instance do not have a mechanism that allows the user to enter the master password but they do look for a master password file in the agent directory of the node associated with that instance.  This means that each instance on that node uses the same master password.  We have updated the command change-master-password so that it creates the master-password file for a node. Commands with the --savemasterpassword option will create or update the master-password file.

Let's look at an example.  In this case, I create a new domain setting the master password to 'welcome1'  and start the domain.  I create an SSH node for the remote host I plan to use for the instances.   I then create an instance on a remote node using the command create-instance which I run on the DAS.    Note that I can create the instance from the DAS but I can not start it unless the master password for the instance matches the master password for the DAS.  At that point I have to go to the instance machine and run the change-master-password command with the --savemasterpassword option set to true so that the master-password file is created in the node's agent directory.  Once I do that I can go to the DAS machine and manage the instance.  Since the master pasword is associated with the node I can then create additional instances from the DAS machine and start or stop them without having to go to the remote host.  I have added the commands that need to be run below.

1) Create and start a domain with the master-password set to "welcome1" using the command .  Note that I did not set a password for admin user.

asadmin create-domain --savemasterpassword true domain2
asadmin start-domain domain2


2) Create an SSH node

 asadmin create-node-ssh --nodehost glassfish1.sfbay.sun.com --installdir /export/glassfish3 node2


3) Create an instance from the DAS.  This creates the instance configuration information and the instance file system.

asadmin create-instance --node node2 ins2


4) At this point the instance is created but it can not be started by the start-instance command because there is no master-password file in the agent directory for that node. That file must exist and it must have the same password as the master password on the DAS. To create that file run the following command on the instance machine.  If I try to start the instance I get the following error:

asadmin start-instance ins2
remote failure: Could not start instance ins2 on node node2 (glassfish1.sfbay.sun.com).

Command failed on node node1 (glassfish1.sfbay.sun.com): The Master Password is required to start the domain.  No console, no prompting possible.  You should either create the domain with --savemasterpassword=true or provide a password file with the --passwordfile option.Command start-local-instance failed.

To complete this operation run the following command locally on host glassfish1.sfbay.sun.com from the GlassFish install location /export/glassfish3:

 asadmin  start-local-instance --node node2 --sync normal ins2
Command start-instance failed.

Go to the instance machine (glassfish1.sfbay.sun.com in this case)  and create the master password file for node2 by typing the following command.


asadmin change-master-password --savemasterpassword true --nodedir /export/glassfish3/glassfish/nodes node2


Important note: At the prompt I have to enter the old master password ('welcome1') which is what I had set when I created domain2 on the DAS. It is not the default master password 'changeit'  because the keystore was copied over when the instance was created and it is encrypted with the master password from the DAS. So the passwords are the same but since start-instance doesn't have an option to take the master password it looks for a file called master-password in the agent directory to access the keystores. Once that file is created, start-instance can be run centrally (from the DAS).

5) Start the instance from the DAS

asadmin start-instance ins2

At this point you can create additional instances from the DAS and start them without going to the instance machine. 

A slightly different scenario is below.  In this case I will begin by creating a domain with the master password set to 'welcome1' as in the previous example, create an SSH node to point to the remote host where the instance will run but I will create the instance locally on the instance machine.  At some future time I want to manage the instance from the DAS so I still need the master-password file created in the node's agent directory. 

On DAS machine:

1) Create  and start a domain with the master-password set to "welcome1" using the command
 

asadmin create-domain --savemasterpassword true domain2
asadmin start-domain domain2


2) Create an ssh node  pointing to the remote host where the instances will run.
 

asadmin create-node-ssh --nodehost glassfish1.sfbay.sun.com --installdir /export/glassfish3 node2

Now we move to the instance machine and create the instance locally and as long as there is no master-password file in the node we need to create one. The command create-local-instance can do that for us.

asadmin --host DASHost create-local-instance --node node2 --savemasterpassword true insL2

In this case, the master password for the keystore in the instance is 'changeit' or the default. Nothing was copied over from the DAS so the password is what is on the instance machine. Again, once the file master-password has been created with the passwordthat matches the one on the DAS, then instance insL2 can be administered from the DAS. Additional instances can be created, started and stopped from the DAS machine.

If the master password is changed on the DAS then you must go to each instance machine and run the change-master-password command as in step 4 above to reset the master password file for each node.

 
 

February 04, 2011

Eclipse makes refactoring fun.

"Well, duh" you say.

For seasoned developers and code gurus, you already know that. But for server guys like myself, the thought of a major refactoring of code -- especially code not authored by self -- leads to nightmares.

I spent the last few days getting intimate with Eclipse Helios and the PDT working on bug 303756. To my own surprise, I am progressing remarkably well thanks to Eclipse's navigation tools, content assist, and the little things like CTRL+SPACE.

January 31, 2011

How to ask questions the smart way ... without so many words?

The "How to Ask Questions the Smart Way" guide that was linked from our forums page is a great guide, but it has way too many words.  Let's face it -- if someone is too lazy to use Google or pick the right forum, are they really going to read all that?

So I've started my own, very abridged version.  Please help me make it better, but focus is on brevity.  This document will be linked from the Eclipse Forums.

Eclipse.org user foums for non-Eclipse.org projects?

This forum post got me thinking:
"Webmaster please create a "Python IDE" topic branch "
http://www.eclipse.org/forums/index.php?t=msg&th=200110

The Eclipse forums are intended for user discussion regarding Eclipse and
Eclipse.org projects. Of course, we don't want to be in the business of
creating hundreds of forums for all the non-Eclipse.org projects out there.
But it occurred to me that there are likely some projects out there that don't
have user forums; users can't easily seek support and are left to fend for
themselves.

Would it be a good idea to create a generic forum to allow users to discuss
non-Eclipse.org projects?

I've opened a bug to track the issue -- please feel free to comment there.

ECF moves to Git

It seems traction for Git is slowly picking up here at Eclipse.org.  This morning I got the "go" to switch the CVS repository to read-only mode for the ECF project, as the team moves their development completely onto Git.

Although a few smaller/younger projects have moved already, ECF is one of the first mature projects with a rich history of several years to make the move.

You can browse the ECF Git repo here:  http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/

Congrats to the ECF team for taking the plunge!

Better (some?) Wifi coverage at ESE

I've never been to Eclipse Summit Europe.  I'm told it's because there's not enough beer in Germany to accommodate my lavish consumption.

Regardless, I've started working with the conference organizers towards providing better/more Wifi coverage at the conference in a manner that would resemble what is provided at EclipseCon.

This is where we play the game of estimating how much Internet bandwidth you'll use up, double the number, then double it again, and then have our calculations be demonstrably wrong once the conference is in full swing.  But that's part of the fun!

This is why I love Open Source Software

As I prepare to replace dev.eclipse.org with new servers, I noticed that IPZilla, a tweaked version of Bugzilla, wasn't working on the new servers.  It was bound to happen -- an antique version of Bugzilla running on the latest Perl.

Googling the error, I stumble upon this 3-year-old post from Max-Alexander Kanat, who responds to a user who is trying to run Bugzilla on a development version of Perl.  For that person, downgrading to the stable Perl works, but I can't (and don't want to) do that.

But Max didn't stop there.  That post raised a red flag, and he diligently opened a bug to investigate.  Patch issued, RESOLVED/FIXED.

I applied the one-line patch to our antique system, and voilà.  RESOLVED/FIXED for me as well.  15 minutes from start to finish.

I love Open Source Software.

Forums and NNTP newsgroups are back online

If you've been missing the forums/newsgroups, you'll be glad to know they are back online now.

Winner of the WTF/loc award

To gauge the quality of code, we've all seen the metric called WTF/minute.



I'm inventing a new metric, called the WTF/loc, based on this very short snippet of code.
#!/usr/bin/perl
use strict;
my $cmd = "perl " . shift;

my $h = <STDIN>;
while ($_ = <STDIN>) {
        open (S, "| $cmd");
        print S $h;
        print S;
        for (2..1000) {
                last unless $_ = <>;
                print S;
        }
}

A few comments to explain what's going on would have made this snippet of code much more maintainable.

Making servers go faster

In computers 101 they teach you that computers can often go faster with more RAM to avoid paging, and to cache files from snail-paced hard drives.

Eclipse.org gets most of its servers from generous donations by companies like Intel and IBM, but often*  the servers lack a bit in the RAM department. When Google made a donation of actual money, we knew exactly where to spend it.



By putting tons of RAM in our front-end Web, CVS, SVN and Git servers, your requests have a good chance of being fulfilled without going to backend servers or, much worse, disk storage.



Here are some of the comments I've seen so far, and we're not even done with the upgrades yet -- we still have to upgrade the Git servers, and dev.eclipse.org for CVS and SVN.

epp-dev: "I've never seen an EPP build finishing so fast. This time it took only 3.5 hours. Compared to 7 to 8 hours that's quite fast. It looks like there is no I/O on build.eclipse.org that causes CPU wait cycles."

Eclipse/Helios Retrospective: "Bugzilla performance is much better"

Webmaster Inbox: "CVS is very fast today"

Many thanks to Google, IBM and Intel for the recent donations, and to AMD, Cisco, HP and IBM for donations made in the past.

* Not always.  The latest servers donated by IBM came packed with 36G of RAM!

What's new at Babel?

The Babel project (crowd-sourced localization/translation) has been a bit quiet lately.  Although there's not much happening on the development front, the translations keep coming in.  Eclipse 3.6 (the base platform for Helios) is over 85% translated for 7 languages (Simplified Chinese, French, Japanese, German, Korean, Traditional Chinese and Spanish).  We have over 72% translation for fifteen other languages, including Arabic, Greek, Polish, Dutch, Italian and Portuguese.

We will be releasing a Helios language pack soon.  If you just can't wait, you can get one of our Nightly builds.

January 03, 2011

Open Letter to WANDisco

Shortly before we all went away on our Christmas holiday, one of the companies that sponsors developers in the Subversion community, WANDisco, delivered a big fu#k you to the rest of the community in the form of a press release and blog post from their CEO Dave Richards.

I commend my fellow members of the Subversion PMC for being able to take a deep breath and wait a couple weeks to respond with a cool head. Had it been up to me alone, I am sure we would have said something that felt good at the time but that we regret later. You can read the official response here on the Apache Software Foundation blog:

Apache Subversion to WANdisco: +1 on the code contributions, -1 on the attitude

I was, and am, deeply offended by Dave Richards and WANDisco in general. Their business model seems to be to issue press releases rather than actually doing stuff. In my experience, companies that choose to issue press releases BEFORE they start working on something are usually to be ignored and I think that is the case here too. The difference is that WANDisco is attempting to portray themselves as leading the Subversion community and as such that they are speaking for the community. As the blog post from the Subversion PMC illustrates, they neither lead the community nor are the welcome to speak for it.

That said, I get it. No one knows or cares who WANDisco is and by issuing press releases and generating controversy a few more people will now have heard of you. Congratulations. Bully for you. However, in the process your actions are only damaging the product and community you claim to care so deeply about. This reveals your true motives.

If you are so desperate for attention that you feel the need to issue press releases we probably cannot stop you. If you absolutely have to to issue a press release to try to garner some attention, then why could you not simply issue something that says "Hey we think features X, Y and Z are important and we wanted to let you know that we intend to direct our resources to work on those features." I could live with that even though I would rather see you work on the features before you crow about it. As it stands, just as you did a year ago with the Obliterate feature, you are just setting your people up for failure. You have declared that you are going to implement new features that the Subversion committers that work for you already know cannot be solved in the near term. You have brought no new ideas to the table nor any idea how any of the known obstacles that have blocked these features will be overcome. To top it off you have attempted to slap a release date on it. Good luck with that.

I really hope that we implement some of the features in your list and it would be even better if we can get some of them done in 2011. Most of your list was already on the roadmap we published last year. Unfortunately, the way you are going about this is not going to help any of that happen and if we do have some success it will likely be in spite of your efforts not because of them.

September 02, 2010

A new direction for bindings?

I'm happy to report that I've been given company approval to port the relevant components of our Flex data binding library back to Eclipse Data Binding.

I haven't started the actual port yet--there are still some concepts on the Flex side that are not a perfect match to Java and existing idioms in Eclipse Data Binding. You'll see what I mean.

To avoid conflating the port to Java with the general API I'm going to just present what the Flex API looks like.

  Bind.from(source, "foo")
.to(target, "bar");

This binding watches the source.foo property, and writes the new value to target.bar each time a change it detected. Now add some validation and conversion magic:

  Bind.from(source, "foo")
.validate(Validators.stringToNumber)
.convert(Converters.stringToNumber)
.validate(Validators.greaterEqual(0))
.validate(Validators.lessThan(10))
.to(target, "bar");

Here we've added several additional steps in the pipeline.

  • After source.foo changes, we first validate that the string can be converted to a number. If so the pipeline continues to the next step, and terminates otherwise.
  • Next we convert the string to a number
  • Now validate that the number is greater than or equal to zero. If so the pipeline continues to the next step, and terminates otherwise.
  • Now validate that the number is less than 10. If so the pipeline continues and the number, now verified to be in the range [0,10), is written to target.bar.

Now suppose our binding is misbehaving somehow, and we want to troubleshoot. We can add logging steps to the pipeline in between the other steps so we can see exactly what is going on:

  Bind.from(source, "foo")
.log(LogEventLeven.INFO, "source.foo == {0}")
.log(LogEventLeven.INFO, "validate {0} is a number")
.validate(Validators.stringToNumber)
.log(LogEventLeven.INFO, "convert {0} to a number")
.convert(Converters.stringToNumber)
.log(LogEventLeven.INFO, "validate {0} >= 0")
.validate(Validators.greaterEqual(0))
.log(LogEventLeven.INFO, "validate {0}

.validate(Validators.lessThan(10))
.log(LogEventLeven.INFO, "set target.bar = {0}")
.to(target, "bar");

(In Flex, string formatting is done with {n} format instead of the %s syntax which Java inherited from C. The log statement passes the values in the pipeline as additional arguments which you can reference in log statements.)

These log steps are a real lifesaver for tracking down and squashing bugs in your binding code.

If you've already worked with Eclipse Data Binding you may have noticed something else: you are no longer constrained to the standard data-binding pipeline. You are free to add steps in the pipeline wherever you like and in any order you like.

Next up is two-way bindings. The bind class provides a twoWay method which connects two bindings to the other one's starting point:

  Bind.twoWay(
Bind.from(source, "foo"),
Bind.from(target, "bar") );

is equivalent to:

  var lock:Lock = new Lock();
Bind.from(source, "foo")
.lock(lock)
.to(target, "bar");
Bind.from(target, "bar")
.lock(lock)
.to(target, "foo");

Notice that each binding has a "lock" step in the pipeline. Only one binding can hold a lock at a time. This solves the common infinite loop problem:

  • source.foo changes. binding one executes, writing the value to target.bar
  • target.bar changes. binding two executes, writing the value to source.foo
  • source.foo changes. binding one executes, writing the value to target.bar
  • ...
  • stack overflow!

Since only one binding can hold the lock at a time, this is what happens instead:

  • source.foo changes. binding one acquires the lock and executes, writing the value to target.bar
  • target.bar changes. binding two attempts to acquire the lock but it is already acquired. binding two aborts.
  • binding one releases the lock

You should never add the same lock more than once to a single binding, since that would guarantee that the binding will never run.

Two-way bindings can use validations, conversions, logging, locks etc just like regular one-way bindings (since two-way bindings are just two one-way bindings wired up to eachother):

  Bind.twoWay(
Bind.from(person, "birthDate")
.convert(Converters.dateToString(dateFormat))
Bind.from(heightText, "text")
.validate(Validators.stringToDate(dateFormat))
.convert(Converters.stringToDate(dateFormat))
.validate(Validators.lessEqual(now))
);

We usually leave out the validations in the model-to-UI bindings. It's usually only important to apply validations when you're copying data back from the UI to the model, to make sure domain constraints are satisfied, such as ensuring that a birth date occurred in the past.

And now for my favorite part: binding from multiple sources, to multiple destinations. Raise your hand if you have ever had to wire up a UI form like this:

  Is there a foo? (o) Yes  ( ) No -- fooRadioGroup

Enter bar: ____________________ -- barText

Requirements:

  1. fooRadioGroup.selectedItem is bound to model.foo (a boolean)
  2. barText.text is bound to model.bar (a string)
  3. barText must be enabled iff fooRadioGroup selection is Yes.
  4. When the user clicks "No," set model.bar to null but do not clear the text box. If the user clicks "Yes" again, set model.bar back to the contents of barText

Requirements 1 and 3 are easy:

  var fooLock:Lock = new Lock();
Bind.twoWay(
Bind.from(model, "foo"),
Bind.from(fooRadioGroup, "selectedItem"),
fooLock); // explicitly provide the lock, see more below

Bind.from(fooRadioGroup, "selectedItem")
.to(barText, "enabled");

Requirements 2 and 4 are kind of related to eachother. The model-to-UI binding is simple enough: just write the value straight across:

  var barLock:Lock = new Lock();
Bind.from(model, "bar")
.lock(barLock)
.to(barText, "text");

However the inverse binding (UI-to-model) must also take fooRadioGroup.selectedItem into account to decide whether to write back barText.text (if Yes is selected) or null (if No is selected).

The Bind class has another trick up its sleeve:

  Bind.fromAll(

Bind.from(fooRadioGroup, "selectedItem")
.lock(fooLock),

Bind.from(barText, "text")

)
.lock(barLock)
.convert(function(foo:Boolean, bar:String):String {
return foo ? bar : null;
})
.to(model, "bar");

Look closely. The binding pipelines that we pass to fromAll(...) become the arguments, in the order they are provided, to the converter and validator functions further down the pipeline. The first pipeline is from fooRadioGroup.selectedItem and therefore that boolean value is the first argument to the converter. Likewise, the barText.text pipeline is provided second, so that string value becomes the second argument to the converter.

The converter takes multiple values but returns only a single value. This is where those values get coalesced into a single value that we can write to the model--in this case, a String value or null.

The outer pipeline adds a locking step on barLock, which is expected since we need to prevent infinite loops between the last two pipelines. However we are also locking on fooLock, on the first of the inner pipelines. We had a problem with our bindings overwriting values in the UI depending on the order things were initialized.

It turned out that without that lock, if a new model object was set, then the foo binding would fire first. Thus model.foo was copied to fooRadioGroup.selectedItem. But that would trigger our last binding to execute, so if the new foo value was false, then the last binding would override anything in the text box and set null on the model.bar field, before the model.bar => barText.text binding had a chance to execute!

A good rule of thumb is that any time you need to bind from multiple sources, you should make sure to create a lock to share between all the bindings to relate to the same field in the model.

Obviously there are several concepts that will have to be adapted to work elegantly with our existing APIs. Realms are a missing piece (Flex is single-threaded so we didn't even have to consider it). Also we would want to try to retrofit the existing binding classes to use this new API transparently, like we did with the transition from custom observables to custom properties.

So there you have it. This is my current vision of what Eclipse Data Binding should evolve toward.

Comments?

August 12, 2010

Back in the Saddle

I've been away (and neglecting Eclipse DataBinding) for a long time now. I want to offer my sincere apologies to any and all who've been affected by my lack of attention.

Now that I've settled back into my old routine, I have a new problem. There is a mountain of new / updated bugs in Bugzilla and not enough free time to catch up on all of them. Please help me prioritize by pinging the tasks important to you! Vote, comment, post patches, whatever you have time for--just let me know where the pain points are.

About the time I disappeared from Eclipse, I started a new job at Overstock.com and it's really an awesome place to work. We're always looking to hire new programmers, so send me a line if you're looking for something new.

While at Overstock I've been doing some Flex development, and (surprise!) working on a data binding library in Flex. Yes, technically Flex already has declarative data binding baked in. What I'm working on brings data binding to the ActionScript side, and gives you full support over the binding pipeline: conversions, validations (sound familiar?), synchronized access, one- and two-way bindings, bindings from multiple sources and coalescing the values together. It's really cool.

This work in Flex has been a golden opportunity to make a fresh start and use the lessons learned from Eclipse DataBinding. Pending company approval I hope to port all that goodness back to Java sometime soon. Stay tuned.

Disclaimer: Opinions are my own and do not reflect or represent my employer.