430 likes | 510 Views
Sponsored by:. Project Members: Sayali Kumbhar Priti Kothari Aalap Doshi Ananta Agrawal. Internal Guide: Mrs.B.S.Tiple External Guide: Ms.Shubhangi Bhagwat. ASpectworkbench. Introduction to AspectWorkbench Background
E N D
Sponsored by: Project Members: Sayali Kumbhar Priti Kothari Aalap Doshi Ananta Agrawal Internal Guide: Mrs.B.S.Tiple External Guide: Ms.Shubhangi Bhagwat ASpectworkbench
Introduction to AspectWorkbench • Background • AspectWorkBench – A Closer Look… • Design Overview • Process • Software Engineering • Future Enhancements overview
A general scenario…. Oh…… its getting too messed up….!! Let me try AOP…. Account Credit() Debit() . . Sr. Developer “Sir, I am ready with the code!!” “Sir……!!!” LoanAccount LoanTrans() EMIDetails() . . Logging “Ok. But where is the logging ?!” “Log the ID, timestamp, balance details…..blah blah blah…” SavingsAccount InterestDetails() BalanceDetails() . . Jr. Developer
privileged aspect LogTransactions { pointcutregister_savings(): call(SavingsAccount.new(int)); before():(call(SavingsAccount.new(int))) { Object[] args=thisJoinPoint.getArgs(); System.out.println("User Registered for Savings Account with ID:"+args[0]); } pointcutregister_loan(): call(LoanAccount.new(int)); before():(call(LoanAccount.new(int))) { Object[] args=thisJoinPoint.getArgs(); System.out.println("User Registered for Loan Account with ID:"+args[0]); } pointcutlog_credit(): execution(void Account.credit(float)); before( Account acc):(execution(void Account.credit(float))) && this(acc) { Object[] args=thisJoinPoint.getArgs(); System.out.println("[Request Sent] for credit of amount "+args[0]+" from aaccount with ID:"+acc._accountNumber); } Object around(Account acc):(execution(void Account.credit(float)))&& this(acc) { Object[] args=thisJoinPoint.getArgs(); Object ob= new Object(); System.out.println("[Request Successful] for credit of amount"+args[0]+" from account with ID:"+acc._accountNumber); ob=proceed(acc); Systemout.println("....Current balance:"+acc.getBalance()+"\n"); return ob; } Uh Oh!!!! Too tedious…!!!!! Jr. Developer
A Solution… SavingsAccount InterestDetails() BalanceDetails() . . Logging Bussiness Application Core Bussiness Logic + Logging + Policy Enforcement + Other horizontal components Policy Enforcement LoanAccount LoanTrans() EMIDetails() . . Monitoring Account Credit() Debit() . . . . . . Many more…. AspectWorkbench
Program Object 1 data Object 4 data Object 2 data Object 3 data Object oriented programming Easier to read & write Better evolvability Better maintainability Better reusability • Encapsulation • Polymorphism • Inheritance Object-oriented Programming
Concerns Concern: “Something the developer needs to care about” (e.g. functionality, requirement,..) Separation of concerns: Handle each concern separately Crosscutting Concerns : Are Concerns cutting across multiple elements in the system.
Program Object 1 data Object 4 data Object 2 data Object 3 data Modularization in oop Typical general examples: synchronization, error handling, timing constraints, user-interface, ...
Scattering and tangling Code Scattering : code for one concern is spread over many modules Code Tangling : code in one module addresses multiple concerns Scattering and tangling tend to appear together
Cost of scattered and tangled code • Redundant code • same or similar fragment of code in many places • Difficult to reason about • the big picture isn’t clear • Difficult to change • have to find all the code involved • be sure to change it consistently • get no help from OO tools
Aspect oriented programming (aop) • AOP builds on OOP and does not replace • OOP • AOP focuses on • modularization of crosscutting • concerns • Compiler driven meshing of intersecting codes • Provides support to software architect to emphasize on separation of concerns right from design phase • Support to popular languages like Java, C++…
AOP terminologies Application Aspect: is analogous to a class in OOP. Aspects define pointcuts and advices to implement crosscutting modules. Joinpoint : A join point is a point of interest where a crosscutting concern intersects the business logic Pointcut : is in essence a construct to capture join points. Advice : is executable code for a pointcut. Object 1 data Object 4 data Object 2 data Object 3 data Aspect joinpoint: ●
: Helper.foo(n/3); : : Helper.foo(i+j+k); : : Helper.foo(x); : Core Code How Aop works Final Code Final Code : System.out.println("foo called"); Helper.foo(n/3); : Weave public aspect Logging { : pointcut logFoo():call(* Helper.foo(..)); before(): logFoo(){ System.out.println("foo called"); … } : } : System.out.println("foo called"); Helper.foo(i+j+k); : Aspect : System.out.println("foo called"); Helper.foo(x); :
Allows the creation of standard crosscutting modules using the Library. What aspectworkbench does… For Team Leader For Developer • Allows the developer to create crosscutting modules without he/she having to know aspectj syntax. For Team Member For Organization • Can use the crosscutting modules prepared by the team leaders in the ‘plug and play’ fashion without having to know anything about AOP. • Clean, easily maintainable, uniform and standardized codes addressing separate concerns.
Technologies… Aspectj Ruby Core of AspectWorkBench. An AOP extension to java. 1. Template creation 2. Pointcut , Advice transformation to XML. 3. Aspect Generation from XML template. Eclipse Platform XML Eclipse Plugin. GUI support. Process Handling. Schema Building XML DOM Handling
sa AspectWorkBench is a plugin to Eclipse 3.x Components…
New crosscutting module wizard • Allows user to create a new crosscutting module. • Extracts the required parameters for creating of crosscutting module CHALLENGES • Getting path of user workspace . • Making a composite page. • Checking the validity of aspect name.
‘outline’ view extension • Exposes intersection points • Extracts information required to create joinpoints CHALLENGES • Extending the eclipse Outline view. • Trying to arrange the options such as to prevent the user from changing his daily usage patterns. • Provides abstraction
Crosscutting tree • This view shows the structure of the crosscutting modules related to the current project. CHALLENGES • XML-DOM parser. • Resource change listener.
library • This component provides the user with a list of ready to use crosscutting modules. • No AOP knowledge is required for the use of Library. • Provides a facility to add to the list. CHALLENGES • Providing an abstraction. • Reusability
Software engineering… Activities Deliverables • High Level Planning • Technology Exploration • Conceptualization Brain Storming • Aspectj, Eclipse, Ruby Seminars • Identification of POCs • POC Projects • Reviews by Guides • Concept Document • Research reports Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 1st August to 15th September • 60pds at 6.1 person hours per day
Software engineering… Activities Deliverables • Review of Scope Document, SRS • Prepare and Review Usecases • Developing Prototype • Prepare detailed Plan • Scope Document • Usecase Document • Usecase Diagram (UML) • SRS Document (IEEE Format) • Software Project Plan • Prototype • Activity Diagram (UML) Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 1st September to 15th November • 1st January to 15th February • 60pds at 6.1 person hours per day
Software engineering… Activities Deliverables • Architecture Workshop • Prepare and Review of Architecture • Architecture Document (4+1 View) Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 15th January to 15th February • 60pds at 6.1 person hours per day
Software engineering… Activities Deliverables • Prepare and Review Design • Review for conformance with Requirements Specification. • Design Pattern Workshops Application Design Class Diagrams XML Schema Design Screen Design Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 1st January to 1st February • 60pds at 6.1 person hours per day
Software engineering… Activities Deliverables • Coding • Ruby for Generator • Eclipse components • Prepare, Code and Review Templates • Codes • XML Files • Templates • GUI components • Help Documentation Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 1st January to… • 60pds at 6.1 person hours per day
Software engineering… Activities Deliverables • Unit Testing • Integration • Testing • Black Box • White Box • Usability • Integration • Log Defects • Bug Fixing • Bug Closure • Test Cases • Test Reports • Defect Logs Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 1st February to …(Unit Testing) • 60pds at 6.1 person hours per day
Software engineering… Activities Deliverables • Packaging and Creating Final executable • Deployable AspectWorkBench plugin. Timelines and Efforts • 1st June, 2005 to 31stJuly, 2005 • 60pds at 6.1 person hours per day
deliverables • AspectWorkbench plug-in • HTML User Manual • Integrated Help
Logging • Error Handling • Policy Enforcement • Monitoring • Maintenance • And many more… USE of Aspectworkbench in Industrial applications
Providing support for wildcards • AspectWorkbench editor for editing advices. • Generalized plug-and-play libraries • Visualizer to show code crosscutting • Support for incremental Compiler Future enhancements
FigureElement moveBy(int, int) refresh() Point Line 2 getX()getY()setX(int)setY(int)moveBy(int, int)draw() getP1()getP2()setP1(Point)setP2(Point)moveBy(int, int)draw() ExAMPLE for inheritance after(): call(void FigureElement+.set*(..)) || call(void FigureElement.moveBy(int, int)){ Display.update();} these methods all end withcall to: Display.update(); public class Point{ ……. public void getY(){ ……. ……. Display.update(); } ……. } Display Updating