|
From: Thomas H. <th...@sr...> - 2002-01-07 16:56:18
|
Hi, I am currently working on implement movement behaviour using aspect oriented programming, so that the agent doesn't have to make calls directly to the space. We have discussed this a little on this list, and I'm just checking the feasibility. Here's where I stand. I am using aspectj as my aop language I have an "introduction aspect" as aspectj calls it, that adds a move method to the class. Basically, an introduction aspect adds new code to an existing class. This way the user never has to see the code, and we don't have issues of multiple inheritence. That's all fine and dandy. Here's the question. In order to use this, the aspect has to be able to determine which classes should have the added behaviour. The best way that I can think of to implement this is with interfaces. For example, a class would declare that it implements MoveableAgent and then the aspect adds the code as appropriate. I wonder, though, if this may be a problem. From the point of view of a user, when you declare that you implement an interface, you always have to implement the methods yourself. Will it be too confusing to declare that you implement an interface without actually writing any code? This was not the clearest note I've written, but I hope my point is somewhat understandable. Please let me know if it is not. Thanks, Tom |