Developing JIRA Studio - Finding Common Ground
Don Brown, Hosted Services talks about StudioJanuary 28, 2008
Plugins are arguably the killer feature for Atlassian products, as they allow you to tweak a theme or deploy full-blown applications within a familiar environment and infrastructure. The number of plugins available, especially for established products like Confluence and JIRA, is huge and the amount of extension points available to plugins basically give you full control of the host application. That much power comes with a price - your plugin is heavily tied to the product, and anyone who has done something similar, like tried to write an application on top of Microsoft Excel with a ton of VBScript, knows how sensitive your Frankenstein application is to host application changes and upgrades, let alone bugs and stability issues.
In JIRA Studio, we are working with the common platform of JIRA, Confluence, Fisheye/Crucible, Crowd, and Subversion, but the applications the user will visually interact with are JIRA, Confluence, and Fisheye/Crucible. If we want to add a new feature like, say, a top navigation bar, we have to add it to each product as a plugin. Since plugins are tightly coupled to each product's APIs, we have to basically write three different plugins. Here are a few of the differences in the latest version of Atlassian products we have encountered so far:
|
|
|
|
|---|---|---|---|
| Components | Setter injection via Spring 2.0.6 | Constructor injection via PicoContainer | Setter injection via Spring 2.5-m1, only used in a few places |
| Web actions | Uses WebWork 2.1.5 | Uses WebWork 1.4 (forked) | Uses WebWork 2.1.7 |
| Settings persistence | Bandana allows you to store any serializable object globally or against a space | PropertySets only support Strings globally or against a project | XML (via XMLBeans) can be added to the main Fisheye config file globally or per repository. |
| Logging | Log4J 1.2.8 | Log4J 1.2.7 | Log4J 1.2.11 |
| HTTP calls | Nice HttpRetrieverService that abstracts HttpClient, deals with authentication automatically (between Atlassian products) | Nothing provided, includes HttpClient 3.0 | Nothing provided, includes HttpClient 3.1 |
As you can see, when writing even a moderately complex plugin, you have to be very aware of the differences across the applications, even in fundamental areas like logging. Furthermore, the differences will force you to write three plugins instead of one: three times the code, unit tests, functional tests, and potential for bugs.
Creating the Studio Application Access Layer (SAAL)
For our own sanity, we've created the Studio Application Access Layer (SAAL), which is a set of service provider interfaces for infrastructure-level features that allow a plugin to rely on key services provided by a single API without having to deal with the multiple implementations. SAAL includes interfaces for the following features:
- Service object lookup
- Logging
- Settings persistence
- HTTP calls
- Internationalised message passing
- Plugin upgrade framework
Our thought is to grow this layer organically for our needs when writing plugins for JIRA Studio. This allows us to a) minimize the amount of code to maintain and b) minimize the conceptual surface area for plugin development. The end game is to have the code interfaces and classes put into Atlassian Plugins, with the individual products responsible for the product-specific service implementations.
This is a good example of how creating JIRA Studio is actually helping the core products as much as creating a new one. You'd think that every product at Atlassian would follow the same development practices, use the same libraries, or even implement individual features the same way if developed at the same time, but alas, that is not the case. Different teams have different leads with different developers, which all amounts to slightly different interpretations of Atlassian ideals, and of course it isn't always feasible or even advisable to, for example, spend months rewriting your web layer with no customer benefit because WebWork 2 was released. A secondary goal of JIRA Studio is to confront those technical differences and try to wrangle them into alignment for the benefit of the customers of both the Atlassian product and JIRA Studio.


5 Comment(s)
Is this "SAAL" likely to be made available to external plugin developers? Any pain you feel when working on plugins from inside Atlassian, we feel far stronger when working from outside, and this would make cross-product plugin writing actually a realistic possibility.
By Dan Hardiker at January 29, 2008 1:07 AM
Dan: yep, in fact, you can check it out now: https://svn.atlassian.com/svn/public/atlassian/studio/studio-aal/trunk (although we may be moving it soon to another public repository).
The first step is to release this plugin as one you can use in your plugins as the products are now. The next step is have studio-aal-core become part of atlassian-plugins and the product-specific plugins, studio-aal-*-plugin, be integrated into the appropriate codebase. IMO, the end goal is that plugin developers would have their own, unified API and wouldn't have to ever touch the ever-changing product API's, but we'll see what happens. For now, providing a single API for core, cross-product features should be a big help, or at least it has been for us so far.
By Don Brown at January 29, 2008 1:15 AM
This is an excellent idea!
~Matt
By Matt Doar at January 29, 2008 10:26 AM
Don, are you sure you want to write, grow and maintain your own plugin framework? Writing a good framework that successfully deals with updatable plugins, dependency resolving and services is not trivial. One example is Eclipse. They did that in the past, but threw away their home-grown solution in favor of the OSGi framework (http://osgi.org/). That one already allows standardized access to service lookup, logging, persisting settings, doing HTTP and contains a well thought-out and tested framework for installing and upgrading components. Having an open standard that is already in use gives you a lot of benefits in terms of available information and development environments too.
By Marcel Offermans at January 31, 2008 7:21 AM
Marcel: Atlassian products have shipped with their own plugin framework for many years, so it isn't a matter of growing; it's grown. I hope this layer is the first step to maybe evolving a new framework, on that would be built on something like OSGi, however, that, if it happened, would be a long ways off.
By Don Brown at January 31, 2008 3:52 PM