While reading a paper in the context of Aspect Oriented Programming, I encountered following statement: Aspects enable scoping variations in space (with a rich variety of  static pointcuts), in time (with dynamic aspects), and in the control  flow (with the corresponding pointcuts). Scoping a variation to the  dynamic extent of an expression is however challenging, since scoping  between threads is not easily realized with aspects.I am already familiar with AOSD: it's primary function is to modularise crosscutting concerns. Yet it is unclear to me what they mean with 'scoping variations', especially the last one: 'scoping a variation to the dynamic extent to an expression'.Could someone elaborate on what these scoping variations mean ?
Scoping behavioral variations to dynamic extents
scope;aspect oriented
Here is my understanding.Aspects enable scoping variations in space (with a rich variety of static pointcuts),This means that a specific section of code can do different things.in time (with dynamic aspects),This means that from the time that you hit one point in code to another, behavior is changed by the aspect.and in the control flow (with the corresponding pointcuts).The flow of function calls changes.Scoping a variation to the dynamic extent of an expression ishowever challenging, since scoping between threads is noteasily realized with aspects.Suppose that you have a multi-threaded program with message passing between threads.  The dynamic extent of an expression is everything that is part of computing that expression, including work done by other threads.So here is what they are trying to achieve.  Threads A and B are both communicating with a worker thread C.  They want what C does to be affected by the state of the thread asking for the work.  But  A and B are independent threads, in different states with different aspects triggered.  This means that you cannot get the desired behavior from C with any of the above mechanisms.Judging from the abstract, their method for achieving this is to pass information in the message that will cause C to delegate important decisions back to the originating thread, which can then be controlled by the aspect to have correct behavior.  I have to wonder what the resulting overhead of this behavior is in terms of extra message passing and context switches.(There is an old saying, To debug code you have to be twice as clever as you were when you wrote it.  So if you write code that is as clever as you can, then by definition you are not smart enough to debug it.  This is why I'm suspicious of AOP, no matter what benefits its adherents have convinced themselves they are gaining...)