Andrew Rubinger wrote:
Had a nice chat with Stuart Douglas on #jbosstesting the other night. He's started up "fakereplace" a hotswapping instrumentation library which aims to overcome the limitation of "no changed schemas".
I think this has some potential to become a valued tool in our expanding arsenal, and I'd like to see how well it incubates.
I absolutely agree with you that fakereplace (or whatever title we end up with) is definitely a critical piece in improving the overall developer experience, following along the same thread for how Arquillian improves the testing experience.
In addition to the fakereplace project , I'll also cite Stuart's blog introducing the tool:
and an initial post that Stuart made in the forums when he was beginning to prototype the project:
There's no doubt about it, there is definitely interest, as evidenced by the many forum threads on seamframework.org that discuss the prospect of an incremental class replacement tool. (We know that Arbi especially likes it).
JRebel is a fairly comprehensive solution, but an open source tool would be better (and is necessary for bundling with any JBoss developer package).
I also want to mention that the kindling of this discussion from Stuart's JBoss Community blog entry is exactly why it's important to have seamframework.org part of this community. There's no way to predict how a project will intersect with the broad range of skill sets at work in this community. If an idea is stuck inside the glass cieling of seamframework.org, it could be missing out on potential opportunity to become a top-level JBoss project. It's all about connectedness.
One thing Stuart mentioned is that he'd like to come up with a new project name. So, given that the JBoss Community is about more than projects conceived by Red Hat employees, I think we should help Stuart to:
1) Get a new name (and approve through legal, etc)
2) Do code analysis on the working prototypes currently in place
3) File the requisite tickets with the .org guys to fire up graphics, SVN, JIRA, etc.
I'll absolutely raise my coffee mug to that.
- fakie - In snowboarding/skating, it's the mirror of a trick. It also implies fakeness.
- retrofit - Fitting new parts onto an old structure (since the deployment itself is not being changed, just the contents)
- Available and I like it
- retrojit or retrokit?
- cafe retro (a play on CAFE BABE)
- retro babe (a play on CAFE BABE)
I also want to add that while it was a cute trick, the hot deployment in Seam 2 feel well short of expectations. Seam 2 would load classes which were not EJBs or Java beans into a URL classloader. When one of those classes changed, the classloader would be discarded and those components reloaded. Stuart cites reasons why this doesn't scale well for developers at the beginning of his blog post. We need to dig deeper for a solution that is going to make developers happy in the long run.
Something else that might be of interest is weblogic fastswap:
As far as I can tell from the description it works in a similar manner to fakereplace, however without the reflection instrumentation. This means that their added methods are visible through the reflection API and it is not possible to change annotation's.
In case anyone was wondering this is what fakereplace can currently do:
- Replace annotations:
As far as I know this is fully implemented
- Add / Remove static fields
- Add / Remove instance fields
- Add / Remove static methods
- Add / Remove constructors
*The 'Mostly Implemented' comes from the fact that there are a few corner cases that do not work properly, the most obvious of these is if you change a method / fields modifiers (e.g. try and make a private field pubilc) it will not work. I know how to work around all these, but many of them are fairly complex so it is not high priority at the moment.
- Add / Remove virtual methods
These are getting there. Adding new methods that do not override superclass methods works fine, if you add a new method that overrides a superclass method it may not always behave as expected (sometimes it will), but this should be fixed in the next week or two.
- Changing superclass
I don't think that this will be possible
- Removing interfaces
I don't think that this will be possible
This may be possible, but it is not on the cards for the 1.0 release
- Changing enums
Not implemented yet, but should be possible
It also has seam integration, so it should be able to re-read the annotations from seam components and generate new proxies for them.
The "discarding the ClassLoader" trick also has problems for managed resources like EJBs. To really discard the CL you also need to deference all objects referencing it, so in EJB this means killing all sessions and flushing all pools. Which, as Stuart and I discussed yesterday, kinda kills the point. By then you have what amounts to an undeploy/deploy cycle.
I personally never understood the allure to non-English words. Not just because I'm an arrogant American, but I doubt most of our target audience speaks Swahili, or is gonna remember it. If we want the project to be sexy we could consider something French, or insist it's pronounced with an Australian accent.
Same applies to made-up stuff, like "Teiid", our awesome data federation project. No offense, but WTF is a Teiid? Even writing this post I had to look it up and correct my spelling from "Teeid". Is it like a Toureag? (All hypothetical questions; yes it's a lizard. And yes, the acronym "EII" is in there).