[aosd-discuss] Help me validate my summaries about AOP/AspectJ

Amol Baviskar amolb at cse.iitb.ac.in
Fri Oct 25 04:31:26 EDT 2002



> Summary about Aspect Oriented Programming/ AspectJ/ 
> Below is what I can summarize from all the reading.
> Please check whether they are right.
>
	
 	
> Concepts about AOP
> ===============
> Before AOP (could be structured or OOP)
> =============================
> 1.	One application (class/classes) has multiple
> modules (methods or functions).
> 2.	One module can have multiple concerns; “main
> concern” and several “auxiliary concerns”. Main
> concern (a method or a function) is what the module
> supposes to do, e.g. credit amount from a credit card.
> Auxiliary concerns help main concern do a job better
> (logging inside the method).
one more point that can be added

One module can have main concern and many auxiliary concerns.We may need
to add auxiliary concern to already existing system.(e.g.Adding
synchronization to code).Adding/Modifying code/concern leads to "TANGLED
CODE" which is difficult to handle.
Separation of concerns from main code solves the problem of code tangling.   

> 3.	What programmers usually do is writing one module
> (a method or a function) for a “main concern” (credit
> amount from a credit card). This is not the problem to
> programmers and AOP is not targeting the main concern.
> 4.	Again, one “main concern” has one module (a method
> or a function).
> 5.	But, one “auxiliary concern” (logging) could
> crosscut several modules. And AOP is supposed to solve
> this problem.
> 6.	Summary: one module could have multiple concerns.
> After AOP
> =======
> 1.	AOP is the programming idea.
> 2.	AOP separate concerns within one module into main
> and auxiliary concerns.
> 3.	Now one main concern has one module (still the
> same).
> 4.	But one auxiliary concern is now confined into one
> module too (This is very very important).
> 5.	AOP is the subset of Separation of concern, SOC.
> 6.	AOP seeks a higher level of modularity. One concern
> (apply to both main and auxiliary concern) is mapped
> to one module.
> 7.	By making a module do just one thing, program
> achieves a higher level of modularity. (even higher
> than that of OOP).
> 8.	Summary: now one module has just only one concern
> (ideally).
> 9.	How can AOP does all the magic? 
> 
> Implementation of AOP
> =================
> 1.	AspectJ is the AOP implementation for Java
> language.
> 2.	AspectJ allowed programmers to write one main
> concern-one module; one auxiliary concern-one module.
> 3.	Then using add-on features, AspectJ let programmers
> weave all different module together the way they like
> during the compile time (Now code become crosscut
> again, just like before AOP).
> 4.	Programmers can also de-weave modules.
> 5.	AspectJ make code more adaptive to changes.
> 6.	AspectJ gives a finer-grained control over program
> execution. For example, using joinpoints, point cuts,
> advices and aspects, programmers do some job (print
> hello to the console) before or after some method
> calls. AspectJ can even look for control block
> (if-else block) inside a method and insert some job.
> 7.	AspectJ gives programmers a power to sneak into
> almost anyway in the program and that is the two-edged
> sword. 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
> _________________________________________________
> AOSD discuss mailing list    -   discuss at aosd.net
> To be removed send mail to discuss-admin at aosd.net
> or visit http://aosd.net
> 


-Amol Baviskar
 Research Assistant( Project Engineer),
 CSE Department,
 IIT Bombay
 Mumbai-India





More information about the discuss mailing list