Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Can we use AspectJ to develop J2ME software?

Well start by determining what the possible cross-cutting concerns are in a J2ME app.

In a J2EE app they're fairly obvious (logging, tracing, transaction support etc).

if you're writing a j2me game, perhaps collision detection would be a suitable area for example:

void updatePlayerPosition (int, x, int y) {
if (currentPosition == positionOfAlien) { <-- this check could be moved into an aspect
      playerEaten;
   }
   player.x = x;
   player.y = y;
}

You should be aware that the aspectjrt.jar needs to be included with your application, so space (this being j2me) may prevent you from using any aspects.

I recommend searching for "refactoring to aspects", it's possibly the best practical introduction to AOP I've come across, and the way it leads you through normal refactorings, can help you to think about where aspects may be useful.

Hope this helps a little

Kev



Back to the top