Mar 10

@EventDrivenArchitecture

AOP, Java, Tech 7 Comments »

I was sitting in a session next to Adrian Colyer, and he showed me what he had literally just hacked up.

It is a nice proof of concept showing a DSL for event driven code.

It allows you to simply specify a publisher:

class Producer {
public Producer() {}

@RaisesEvent("price-update") private int price;

@RaisesEvent("calculation-complete")
public int calculate(int x, int y) {
return x*y;
}

public void setPrice(int price) {
this.price = price;
}
}

and a subscriber:

@EventSubscriber static class Recipient {

// exposed public fields for testing
public int calculationResult = 0;
public int price = 0;

@OnEvent("calculation-complete")
void onCalculationCompletion(MethodBasedEvent event) {
System.out.println("calculation-complete, result = "
+ event.getResult());
calculationResult = (Integer)event.getResult();
}

@OnEvent("price-update")
void onPriceUpdate(FieldBasedEvent event){
System.out.println("price-update, new price = "
+ event.getValue());
price = (Integer) event.getValue();
}
}

I hope that this could be firmed up, and maybe at some point make it into the ajlib project! :)

Mar 08

Annotating language extensions

AOP, Java, Tech 3 Comments »

Ramnivas Laddad has got a two-part article series AOP and metadata: A perfect match, part of the AOP@Work series, in the queue.

He also talks about using annotations for compile-time, and strucural modifications to a program.

E.g., wouldn’t this be a nice way to simplify get/setters (a la Groovy):

public class Person {
@Property(ReadOnly) private long id;
@Property private String name;
}

It is going to be very interesting to see how these types of annotations get into the system. Will open source projects start building them? Will we wait for the JCP to standardize on them?

Adrian Colyer has taken Ramnivas’ idea and whipped it up using AOP (showing that you don’t need a custom APT (annotation processing tool)).

Mar 05

The Future Holy Trinity of Development

AOP, Tech 3 Comments »

Adrian Colyer is here at TSSS. It is always a pleasure to chat with him, and he just today posted on The New Holy Trinity.

The nice part of this piece, is that Adrian has taken a lot of what has been said in this area, and puts it together in a nice way. It is one of those resource blogs which you shove up in del.icio.us for use in the future.

Mar 05

Cameron: Relational Algebra doesn’t work with Aspects

AOP, Tech 100 Comments »

Cameron simply doesn’t get it. I am all for AOP, as you can probably tell (based on Hani’s findings ;).

However, I am also very anal about the beauty of SQL, and how relational algebra can be PROVEN. This is one of the reasons why it can be tempting to write code based on this model versus procedural logic which can not be proven.

What the hell happens to this model when AOP gets in the middle? It screws everything up, that is what happens. How can I prove something when an aspect can be weaving into my SQL code on the fly. It just doesn’t work.

However, that being said, if tool support comes along, then it WOULD be tempting to give this all up to get the bonuses of SQL AOP.

I think the jury is still out on SQL AOP.

Mar 03

Ansi SQL-AOP 2015 Released

AOP, Tech 2 Comments »

A new ANSI-SQL standard has been released, named SQL-AOP 2015. The aim of this sub-spec is to take SQL to the next level, and enable AOP support. Now, your DBA can package cross cutting concerns in “stored aspect libraries” in the database.

Some of the features include:

  • Rich pointcut language for SQL
  • Capture before/after/around advice on any SQL statement
  • Advise PL/SQL, T-SQL, or other code
  • Force caching semantics based on AOP policy advice
  • Logging
  • TX semantics
  • Security filters (including: instance based)

You can capture rich semantics such as:

Before the trigger named ‘foo’ causes a change to index ‘x’ make sure that you update ‘bar’

Load up the cache for tables x, y, and z, when a SELECT captures fields f1, and f2, on table t1

Larry Ellison was quoted as saying:

SQL-AOP is going to revolutionize the world of computing. The database is the network. Finally, my vision of the network computer can come to fruition and I can finally make fun of my good friend Steve Jobs.

A developer at TheServerSide symposium responded with:

Finally, I can get rid of the logging code that I scatter in my PL/SQL scripts. This is a god-send for database computing.

Microsoft SQL Server specialists commented that:

We are watching the standard closely, and will only copy from those that go before us. We also have MSSQL-AOP that we are working on, that is similar to this standard, but we changed some of the names, and embedded it into the core .NET framework.

Mar 01

TheServerSide Symposium, Microsoft Dev Summit, and AOSD

AOP, Ajax, Conference, Java, Microsoft, Tech, Travel 1 Comment »

I have a fun and busy couple of weeks coming up:

TheServerSide Symposium

This week I will be in Vegas for the 3rd TSS Symposium. It is always a pleasure to see everyone, have some good geek talk, and some drinks ;)

I am going to be presenting on AJaX technology, Groovy, and may even be on a panel ;)

Microsoft Developer Technology Summit

I am really looking forward to the Microsoft summit, with the likes of Matt Raible, Ben Galbraith, and everyone else. It will be really interesting to see what Microsoft has to say to us, how they pitch it, etc. I am going to soak up having the time to spend looking at Indigo and the like.

I was even going to see if Don would like to bring in his kids to do some Ruby, but I guess now It’s down to Scheme or Logo :)

AOSD

AOSD is in Chicago this year, which is nicely down the road. I will be chairing a panel, and spending time with great guys to discuss libraries for AspectJ 5, which I am really excited about.

All, in all, a great few weeks! I hope to see some of you there!

Feb 27

JST: JavaScript Templates

AOP, Ajax, JavaScript, Tech, UI / UX 43 Comments »

You gotta love adding to “JS?” acronyms. Now we have JavaScript Templates, which, as Aslak talks about, can work well in the new world of Ajax.

Here

Feb 23

AOP Survey

AOP, Tech 2 Comments »

The new AspectJ 5 team has put together a survey which is aiming to gather up info on our usage of AOP. If you are an AOP-ite, help them out :)

Hi everyone.

As part of the AspectJ 5 effort between the AspectWerkz and AspectJ teams, we are inviting you to participate in a web based survey about your usage of AOP, especially in Java.

This survey will help us to prioritize and to organize our milestones according to the community needs and requirements. It consists of 20 questions with answer choice, so it should require around 5 minutes to go through.

Take the survey now : http://aspectwerkz.codehaus.org/survey.html

Thank you.

/Jonas

Feb 17

AspectJ2ME: Using AOP for running J2ME on any phone

AOP, Java, Mobile, Tech 1 Comment »

Michael Yuam explains how Tira Wireless does WORA with Aspect Oriented Programming.

Tira Wireless is a very successful J2ME game porting house with big name customers like Disney and Warner Brothers. It takes J2ME games from developers and port them to more than a thousand handset/wireless operator/language combinations for global distribution. As one would expect, they have intimate knowledge and hands-on experience with many JVM implementations to know how exactly “write once, run everywhere” does not work in J2ME. :) Today, Tira Wireless sent two engineers from Toronto down to Austin on a Sunday to sit down with me and explain to me exactly how their approaches work. To my pleasant surprise, their approach is “aspect oriented programming” using a customized version of Javassist (the same underlying library for JBoss AOP)!

The concept is really pretty simple. In regular AOP, the aspects are cross cutting several different classes. In Tira Wireless’s Jump transformation engine, an aspect is a specific class-level bytecode modification that has to be done (i.e., cross cutting) across several handsets. Better yet, Tira wireless’s has profiled more than 200 handsets and distilled a set of commonly used transformations for you! Those prepackaged aspects/transformations include swapping soft button labels, using multiple images to replace faulty image flip calls, catching certain exceptions, changing thread behaviors, and changing app start/pause behaviors. For each application port, Tira Wireless’s Jump developer tool lists a set of recommended aspects/transformations for those two devices and other possible transformations for you to choose. The following shows the aspects available for the Nokia 3650 to Motorola V300 port and the Nokia 7210 to Nokia 3650 port.

AspectJ2ME ?

Feb 17

AspectJ2ME: Using AOP for running J2ME on any phone

AOP, Java, Mobile, Tech No Comments »

Michael Yuam explains how Tira Wireless does WORA with Aspect Oriented Programming.

Tira Wireless is a very successful J2ME game porting house with big name customers like Disney and Warner Brothers. It takes J2ME games from developers and port them to more than a thousand handset/wireless operator/language combinations for global distribution. As one would expect, they have intimate knowledge and hands-on experience with many JVM implementations to know how exactly “write once, run everywhere” does not work in J2ME. :) Today, Tira Wireless sent two engineers from Toronto down to Austin on a Sunday to sit down with me and explain to me exactly how their approaches work. To my pleasant surprise, their approach is “aspect oriented programming” using a customized version of Javassist (the same underlying library for JBoss AOP)!

The concept is really pretty simple. In regular AOP, the aspects are cross cutting several different classes. In Tira Wireless’s Jump transformation engine, an aspect is a specific class-level bytecode modification that has to be done (i.e., cross cutting) across several handsets. Better yet, Tira wireless’s has profiled more than 200 handsets and distilled a set of commonly used transformations for you! Those prepackaged aspects/transformations include swapping soft button labels, using multiple images to replace faulty image flip calls, catching certain exceptions, changing thread behaviors, and changing app start/pause behaviors. For each application port, Tira Wireless’s Jump developer tool lists a set of recommended aspects/transformations for those two devices and other possible transformations for you to choose. The following shows the aspects available for the Nokia 3650 to Motorola V300 port and the Nokia 7210 to Nokia 3650 port.

AspectJ2ME ?