Friday Jul 20, 2012

Metaprogramming: Manipulating Data About Data

Metaprogramming is the secret behind the success of many Java frameworks such as Spring and Struts 2, and constitutes the backbone of many of the most fundamental APIs across the Java EE technology stack. More importantly, you can use metaprograming for improving your apps and app testing. In his session The Art of Metaprogramming in Java, presented at OSCON, Abdel Remani (@PolymaticCoder) explained the philosophy and theory behind metaprogramming, and then showed code examples illustrating the different mechanisms and techniques developers can use to take advantage of this underused feature of the Java programming language.

Remani started with an overview of metadata. Metadata is "data about data," for example, most people are familiar with HTML meta tags. Javadoc is also an example of metadata. The most common way to generate and display metadata in Java is using annotations. JSR 175 (A Metadata Facility for the Java Language) was introduced in Java SE 5.0, and it standardized how annotations are declared in Java code. JSR 250 introduced Common Annotations for the Java Platform. You can write your own java.lang.annotation package, just tell the Java compiler how the annotations are to be treated, including the element types to be annotated, retention policies, and default values.

Metaprogramming is writing programs that manipulate other programs or themselves based on metadata. One good use case is saving scanned metadata for use later during runtime, allowing for quicker startup of your application. Since there are no commonly defined best practices in the area of metadata, Remani calls this a "big boy's exercise." You can access metaprogramming at runtime via JSR 299, Pluggable Annotation Processing API. He recommends the following steps: 1) Define metadata, 2) Process metadata, 3) Construct a metamodel, and 4) Validate the metamodel.

Here are some of the libraries available to use for metadata processing:


Finally, Ramani introduced Project Averroes. His vision for the project is a metaprogramming framework that provides auto-discovery of annotations, annotation processing, metamodel construction and validation. "It is," he concluded, "a work in progress." Project Averroes is open source, and he welcomes comments and contributions. 


Making the Most of Java's Metadata: Custom Annotations

Wednesday Jul 18, 2012

Open Source 2.0: The Science of Community Management

Welcome to the mind of David Eaves (@daeaves), public policy entrepreneur, open government activist and negotiation expert. Speaking in a rapid fire style, Dave admitted to "dumping" hours of negotiation theory in a few minutes in his OSCON session "Open Source 2.0: The Science of Community Management." I, for one, was delighted to be soaked by the firehose.

Dave started by debunking the 3 Great Myths of Open Source communities:

Myth 1) Your Open Source Community is a Meritocracy.

Admit it, the first 10 people to join your project have much more power than the next 10 that join, even the next 100. The first UI person to the project will be "the UI guy," it will take a serious stumble by him or a person drastically better then him to be displaced. The meritocracy myth is particularly harmful because it creates the promise that if you work really, really hard, you will have the same opportunities as everyone else in the community. Because of human nature, that's just not true. People are generally creatures of habit and go to the people they already know. It takes real effort to expand the circle/change their ways. For more information, you can read Structurelessness, feminism and open: what open advocates can learn from second wave feminists (this is in part about why open source communities are not pure meritocracies).

Myth 2) Open Source is about Collaboration

The genius of open source is how *not* to work together. It's about taking complex problems, breaking them into chunks and that individual developers can go work on and then can slide back into the whole. Collaboration is slow, expensive and high touch, community leaders should always think of ways to move from collaboration to cooperation. For example, it used to require long negotiations with the owners of the trunk to get extensions into Firefox (collaboration). With Firefox addons, community members could add functionality and users could pick it up much more easily (cooperation).

Myth 3) Coders Don't Need Soft Skills

If the success of your open source project is attracting (and keeping) community members, then your soft skills are your differentiator, not your coding chops. Be aware of the assumptions you bring to every conversation (Is this a negotiation? What's my goal? Is my goal just to prove the other guy wrong?). Your mindset can be resources are scarce, this is a battle, and eveyone else is stupid, crazy and evil. Or, you can believe that the pie can be made bigger, this is cooperative venture and people do what they believe is in their best interest. As a community leader, you can set the tone and maximize the outcome. Your job is not only to listen to what someone is saying, but to find out what are their real interests and concerns. A good solution may be closer than you think.

Architect in Cooperation

How can the OS community build "cooperation" into tools? Dave gave a few simple examples that would make Bugzilla more friendly:

Making Bugzilla a Little Friendlier

  • marking a user a new or that English is their second language (ESL) [think before you flame]
  • sample text in a fields that models "right behavior"  
  • providing a "Why?" field (getting to the underlying need).
  • creating a "support" state (which automatically generates an email that has links to similar entries in the support database rather than only giving a user-hostile reply of "invalid).

Tools are especially challenging area for the open source community, but it is time to start asking for (or building) ways to minimize the high ‘transaction costs’ it takes to work your project. There's lots of work to do, but knowing you have a problem is always the first step. :-)

For more information, Dave provided links to Posts on Open Source Community Management. There's also a nice set of notes on the session by Jeff Longland.

Monday Jun 04, 2012

OSCON: Java and a Nice Discount

OSCONNow in its 14th year, OSCON, O'Reilly's annual open source conference, will once again be in Portland, OR on July 16-20, 2012.  Join the world’s open source pioneers, builders, and innovators at the Oregon Convention Center for five intense days to learn about open development, challenge your assumptions, and fire up your brain.With 200+ speakers, 18 tracks, hundreds of technologies, and over 3,000 hackers in attendance, it's a place to learn and network.

You’ll find practical tutorials, inspirational keynotes, and a wealth of information on open source languages, platforms, and development. OSCON includes whole track devoted to Java & the JVM, and the list of speakers is impressive.

OSCON is where the serious thinkers and doers—and their favorite technologies—converge. And when the day’s sessions are over, join people just like you for some serious fun.

Thanks to Java Magazine (you have subscribed to Java Magazine, right? If not, get your free digital subscription now!), you can register for OSCON and save 20% with code JAVAMAG.

Java Mag

Tuesday Jul 26, 2011

Open Source, Java, and Oracle - Cracking the Code

OSCON might be an odd place to say that Oracle doesn't have an open source strategy. Rather, it has a large company strategy to deliver complete, open and integrated solutions to their customers. Steve Harris, Senior VP, App Server Dev, Oracle, said just this in his keynote at OSCON Java yesterday. To explain how Oracle thinks of open source, Harris said that the company does not have a top-down strategy around open source, but rather individual lines of business have open source strategies to meet business needs. In relation to Java, which resides in the Oracle Middleware line of business, the priority is to keep Java vibrant with increased investment in platform, continuing to move towards free and open, and to improve support for the Java developer community. In a nod to Oracle's understanding of perceptions about Oracle in the open source community, Steve Harris introduced the humorous "Perceived Open Source Threat Level" graphic and said "We’re not where we should be, but it has gotten better and it will get better. ”

Watch the keynote, courtesy O'Reilly Media.

Sunday Jul 24, 2011

OSCON Java: Already Great

OSCON Java hasn't even officially started, but I can tell you it's already great.

The Community Leadership Summit was on Saturday and Sunday. Community leaders from several different types of communities (software, hardware, medical, library science, personal training, to name a few) discussed issues around building and maintaining communities. Topics included getting a community started, dealing with international communities (more than just time zone challenges), open source licensing, what is it that community managers actually do, dealing with difficult community members, how to justify your existence to upper management (KPIs, anyone?), and sexual harrassment at technical conferences and in online communities (Tim O'Rielly just posted Sexual Harassment at Technical Conferences: A Big No-No). The first day ended with some wonderful stand up comedy by Sumana Harihareswara, specifically for a techie audience ("Was anyone else disappointed to learn that the movie Source Code had nothing to do with source code?"). A big tip of the Duke's cowboy hat to the team who made CLS11 happen.

On Sunday was the OSCON JVM Language Symposium. There were lively dicussions about different languages on the Java Virtual Machine.  Jeff Genender said main takeaway from the day was "It's the JVM, stupid!" Sunday evening was the speakers dinner, a time for the speakers to stop tweaking their slides and mingle. It was a great mix of old friends and new acquaintances.

Overheard at the OSCON Java Speakers Dinner

"I've noticed an uptick in demand for Java developers in the last few months."

"I've been up 40 hours straight."

"My session got accepted for JavaOne!"

"Let's get a picture of the Google, Apache and Oracle guys together!"

  Van Riper(Google), Jeff Genender (Apache), Steve Harris (Oracle),
    and Sharat Chander (Oracle) Show Their Community Spirit

and best quote of all:

"You probably don't want to start your talk with "Java sucks" at a Java Conference."

It's already started as a great conference. If you can't be here, the keynotes more will streamed live on the OSCON site. Here's Monday's schedule:

  9:00am - 9:10am     Welcome Laurel Ruma (O'Reilly Media, Inc.), Stephen Chin (GXS)
  9:10am - 9:30am     Open Source, Java, and Oracle – Cracking the Code Steve Harris (Oracle)
  9:30am - 9:45am     Twitter: From Ruby on Rails to the JVM Raffi Krikorian (Twitter)
  9:45am - 10:00am   Working Hard to Keep It Simple Martin Odersky (Typesafe)
10:00am - 10:10am   JDK 7 in a Nutshell Joe Darcy (Oracle)
  7:00pm - 9:00pm    Ignite OSCON


Insider News from the Java Team at Oracle!



« June 2016