Hi Pengcheng: it sounds like that using AspectJ it is easier to check the object form of the LoD. Or can we also check the class form? Checking the object form is useful but it depends on the inputs wether we detect violations of LoD. Checking the class form is static and does not depend on inputs. Our goal is to write a collection of LoD aspects that can be used with any Java program to report LoD violations either statically or dynamically. All LoD violations should be written into a LoD-log file. -- Karl =========== According to my yesterday's experiment, I can conclude that we can check all the situations in the program which violate the LoD that says in the method body of a class, the method calls can only happen to those target objects that are direct child objects of this object, locally construted objects or the objects passed in through arguments of the method. But all those check are during run time, so it is dynamic checking. Yes, I agree with you in that dynamic checkin has many limitations, one of which is the checking is dependent on the program inputs. Running the checking in different time may produce different reports, depending on the run time object structure or control flow. But I don't think AspectJ can easily do the static checking. My feeling is that to do the static checking, we have to build a statical analyzer and do the data flow analysis. --Pengcheng ========== But the object version of the Law of D has also advantages! Please can you send me first draft of your working code even if it is not complete. I would like to post the final solution on the LoD page. This has been a need for a long time to have a LoD checker. It is also good advertisement for AspectJ. And it is easy to use by Java/AspectJ programmers. How does your work compare with Minsky's? This would be a nice little article in IEEE Software. -- Karl ============ Hi Karl, It is at: /home/wupc/try/LoD/Check.java Currently, it still complains about the situation of calling methods on argument objects. All other situations should be fine. --Pengcheng