This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: AspectJ and J2ME
Feed Title: ShareMe Technologies LLC-The Mobile Future
Feed URL: http://www.jroller.com/shareme/feed/entries/rss
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology.
As you may know using preporcessing statements is problematic in J2ME. They do not get picked up by IDE incremental builders and thus you only see the errors after a complete full build which significantly increases the development time and debug time.
What if you could isolate the code base into its own functional module of base dcocde whereas the optional features were only called upon when those featurs were present on devices? Last year several people presented presentations of how to use AspectJ for this purpose in J2ME development but not enough details to be usefull.
Trevor Young's Thesis does provide enough detais that you cna build an J2ME CLDC comp liant AspectJ runtime and a build sequence to use AspectJ programming in J2ME for this set of exact purposes. There has been a patch to ApsectJ1.5.1 so that just by eliminating classes providing features we do nto use in J2ME should be enough to build a compliant CLDc versionof the AspectJ runtime for use in J2ME development.
According to Trevor's thesis, the only preprocessing commands you would be using in this case would be chaining features together in the prooprer order in the case of multiple optional features that rely on one another. Becasue using AJDT you would get complete access to having code checked by the incrmental build it should also save debug time in completeing a port for such use as internationlization, porting, IPD version differences, and etc.