Last updated : 05/09/2002; 08:02:42

Joe's Jelly

Joe Walnes rambling on and on about Software Development, Java and Extreme Programming.

NAVIGATION >>

/WIKI /WEBLOG /THOUGHTWORKS /OPENSYMPHONY /EMAIL

:: ELSEWHERE
xp developer wiki
c2 xp wiki
the server side
javaworld
sd magazine
jakarta

:: BLOGS
Mike Cannon-Brookes
Graham Glass
Paul Hammant
Elliotte Rusty Harold
Darren Hobbs
Patrick Lightbody
Charles Miller
Brett Morgan
Rickard Öberg
Mike Roberts
Sam Ruby
Joel Spolsky
James Strachan
Clemens Vasters
:: BACKLOGS
August 2002
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jul   Sep



Click here to visit the Radio UserLand website.

:. 17 August 2002

  10:12:53 PM  

AOP and A Really Cool Feature. .... [snip] ....

I have interceptors that capture all state-modifying calls to my object model and add them to a list, which can then be "applied" on the server object model in one go. And it's not limited to set-methods really. I can have lifecycle methods such as "create" and "remove" too, and similarly I can do fine-grained ACL checks on the server.

But this isn't really the cool feature I was hinting at. No, because the next step is this: if you can capture all state-modifying calls on the client, and play them as a "script", shouldn't it then be possible to implement undo/redo functionality by simply removing/re-adding invocations on that script-list? I.e. I can do stuff on my object-model, pretty much whatever, and have my client automatically allow for undo/redo from a menu or Ctrl-Z or similar. You know, like a regular application.

[Random thoughts]

That IS cool. That's even cooler than using aspects for async messaging (although only just) :).


  10:00:02 PM  

Dabblings with AltRMI and asyncronous messaging.

Quick detour: AltRMI is a replacement for RMI. Unlike RMI, it adds no constraints to objects that are remote so you're not forever messing around with things like RemoteExceptions and objects can be transparently distributed. Apart from allowing for simpler code, it has incredible performance (muuuch faster than Sun RMI, IIOP, SOAP, t3, ORMI, etc) and has many pluggable ways of providing transports. For any kind of object that requires distributed objects, this is now my middleware of choice.

Imagine this...

public interface DealSystem {
  void makeDeal(Deal d, Trader t);
  Trader[] listTraders();
 
}
public class CustomDealSystem implements DealSystem {
 
  public void makeDeal(Deal d, Trader t) {
    /* ... */
  }
 
  public Trader[] listTraders() {
    /* ... */
  }
 
}
/* client */
DealSystem dealSystem = (DealSystem)factory.lookup("DealSystem");
dealSystem.makeDeal(someDeal, someTrader);

A clean and simple interface/implementation seperation you'd expect to see in most applications. The implementation is being looked up from the AltRMI factory and could be an in VM object or located somewhere else. Either way, calling the methods repeatedly could take a long time due to possible network latency or because the actual implementation method spends a while doing stuff.

However, seing as AltRMI already has the mechanism in place to serialize method calls over a stream, what's to stop them from being invoked asyncronously? So, with no modifications to the interface, implementation or client, a configuration setting could specify that the makeDeal() method should be called asyncronously. Behind the scenes AltRMI can route the calls to a backing message server. Obviously async methods are constrained to not throw exceptions or return anything, so listTraders() has to be sync.

This is a much cleaner interface to async messaging than JMS provides as you just call methods using their preferred signature instead of playing with things like message objects.

As a pair-programming and unit-testing excercise, myself, Charles Lowell (work colleague) and Paul Hammant decided to implement this. Started but not complete - we'll let you know how we got on. Yes of course, we test-first and pair-program. :)

There's some overlap here with the AOP stuff Rickard is playing with seeing as asyncronous calls are being implemented as aspects - I wonder where to next...... ?


  11:02:25 AM  

AntEater. Also there's AntEater, which is all based on Ant tasks. Jelly can process Ant tasks inside JellyUnit so you could combine the features of JellyUnit and AntEater and maybe Latka all together in one JellyUnit script! [james strachan's musings]

Don't forget Canoo WebTest! This is yet another Ant based web-testing toolkit, but it focuses more on testing from a user's point of view than by HTML. I find this much more intuitive and it allows automation of many user acceptance tests which are harder to express with other test harnesses.


Web-design by John Doe from open source web design.