SlideShare ist ein Scribd-Unternehmen logo
1 von 36
ASPECT-ORIENTED SOFTWARE
DEVELOPMENT
CONTENTS
21.1 The separation of concerns
21.2 Aspects, join points, and pointcuts
21.3 Software engineering with aspects
Prepared by Razık Can PAHALI, 15002697
OBJECTIVES
 Understand why the separation of concerns is a
good guiding principle for software development;
 Have been introduced to the fundamental ideas
underlying aspects and aspect-oriented software
development;
THE SEPARATION OF CONCERNS
 Organize your software so that each
element in the program does one thing
and one thing only.
 Class, method, procedure, etc.)
 AOSD uses a concept of
horizontal slices through
vertically-decomposed
software components.
THERE ARE SEVERAL DIFFERENT TYPES OF
STAKEHOLDER CONCERN:
 Functional concerns,
 Quality of service concerns,
 Policy concerns
 System concerns,
 Organizational concerns.
1.The Separation of Concerns
• The separation of concerns is a key principle of software design and
implementation.
• It means that you should organize your software so that each
element in the program
(class, method, procedure, etc.) does one thing and one thing only.
• With all this taken into account, maintenance and updating will be
easier.
• When changes are required, they are localized to a small number of
elements
• Although it is generally agreed that separating concerns is good software
engineering practice, it is harder to pin down what is actually meant by a
concern.
• Sometimes it is defined as a functional notion (i.e., a concern is some element
of functionality in a system).
• Alternatively it may be defined as any piece of interest or focus in a program.
• According to Jacobson and Ng (2004), concerns are really reflections of the
system requirements and priorities of stakeholders in the system.
• System requirements may be a concern ranging from users wanting a faster
response time from the system to stakeholders feeling inclusion of a
particular functionality is needed.
• According to Jacobson and Ng (2004), concerns are really
reflections of the system requirements and priorities of
stakeholders in the system.
• System requirements may be a concern ranging from users
wanting a faster response time from the system to stakeholders
feeling inclusion of a particular functionality is needed.
• A concern can therefore be defined as something that is of interest
or significance to a stakeholder or a group of stakeholders.
• The core concerns of a system are those functional concerns that relate to its
primarypurpose.
• Therefore, for a hospital patient information system, the core
functionalconcerns are the creation, editing, retrieval, and management of
patient records.
• In addition to core concerns, large systems also have secondary functional
concerns.
• These may involve functionality that shares information with the core
concerns, or which is required so that the system can satisfy its non-
functional requirements.
New Customer
Requirements
Account
Requirements
Customer
Management
Requirements
Security Requirements
Recovery Requirements
Core Concerns
Cross-cutting
Concerns
• The cross cutting example in Figure 1 is based on an internet banking system.
• This system has requirements relating to new users, management of existing
users and management of customers.
• All of these core concerns are associated with the systems primary functions-
the internet baking service
• However the system also has security requirements and recovery
requirements.
• These are cross-cutting concerns as they may influence the implementation
of all of the other system requirements.
 Programming language abstractions, such as procedures and
classes, are the mechanism that you normally use to organize
and structure the core concerns of a system. However, the
implementation of the core concerns in conventional
programming languages usually includes additional code to
implement the cross-cutting, functional, quality of service, and
policy concerns. This leads to two undesirable phenomena:
tangling and scattering.
• Tangling occurs when a module in a system includes code that
implements different system requirements.
• The related phenomenon of scattering occurs when the
implementation of a single concern (a logical requirement or set of
requirements) is scattered across several components in a
program.
• This is likely to occur when requirements related to secondary
functional concerns or policy concerns are implemented.
• Problems with scattering and tangling occur when the initial system requirements change.
For example, say new statistical data had to be collected in the patient record system.
• The changes to the system are not all located in one place and so you have to spend time
looking for the components in the system that have to be changed. You then have to change
each of these components to incorporate the required changes.
• This may be expensive because of the time required to analyze the components and then
make and test the changes.
• There is always the possibility that you will miss some code that should be changed and so
the statistics will be incorrect.
• Furthermore, as several changes have to be made, this increases the chances that you will
make a mistake and introduce errors into the software.
2.Aspects, join points,
and pointcuts
TERMINOLOGY USED IN ASPECT-ORIENTED SOFTWARE
ENGINEERING
Term Definition
advice The code implementing a concern.
aspect A program abstraction that defines a cross-cutting concern. It includes the
definition of a pointcut and the advice associated with that concern.
join point An event in an executing program where the advice associated with an aspect
may be executed.
join point model The set of events that may be referenced in a pointcut.
pointcut A statement, included in an aspect, that defines the join points where the
associated aspect advice should be executed.
weaving The incorporation of advice code at the specified join points by an aspect
weaver.
AN AUTHENTICATION ASPECT
aspect authentication
{
before: call (public void update*(..)) // this is a pointcut
{
// this is the advice that should be executed when woven into
// the executing system
int tries = 0 ;
string userPassword = Password.Get ( tries );
while (tries <3 && userPassword != thisUser.password ( ) )
{
// allow 3 tries to get the password right
tries = tries + 1 ;
userPassword = Password.Get ( tries ) ;
}
if (userPassword != thisUser.password ( )) then
//if password wrong, assume user has forgotten to logout
System.Logout (thisUser.uid) ;
}
} // authentication
ASPECTJ - JOIN POINT MODEL
 Call events
 Calls to a method or constructor
 Execution events
 Execution of a method or constructor
 Initialisation events
 Class or object initialisation
 Data events
 Accessing or updating a field
 Exception events
 The handling of an exception
POINTCUTS
 Identifies the specific events with which advice should be
associated.
 Examples of contexts where advice can be woven into a program
 Before the execution of a specific method
 After the normal or exceptional return from a method
 When a field in an object is modified
ASPECT WEAVING
 Aspect weavers process source code and weave the aspects into
the program at the specified pointcuts.
 Three approaches to aspect weaving
 Source code pre-processing
 Link-time weaving
 Dynamic, execution-time weaving
ASPECT WEAVING CONT.
3.Software engineering
with aspects
TYPES OF EXTENSION
o Secondary functional extensions
o Policy extensions
o Quality of service extensions
o Infrastructure extensions
CONCERN-ORIENTED REQUIREMENTS ENGINEERING
 It’s important to separate concerns while determining the
requirements engineering.
 Requirements for the core system as well as requirements
for the system extensions should be identified.
 Apart from secondary functional requirements, there are cross-
cutting concerns which reflect policy and quality of service
non-functional requirements that apply to the system as a whole.
 Having too many concerns or extensions to the system is not
recommended as it might lead to a system design that does not
conform to its quality of service requirements.
ASPECT-ORIENTED DESIGN/PROGRAMMING
 Aspect-oriented design
 The process of designing a system that makes use of aspects to
implement the cross-cutting concerns and extensions that are
identified during the requirements engineering process.
 Aspect-oriented programming
 The implementation of an aspect-oriented design using an
aspect-oriented programming language such as AspectJ.
USE CASES FROM THE INVENTORY MANAGEMENT SYSTEM
A GENERIC ASPECT-ORIENTED DESIGN PROCESS
DESIGN ACTIVITIES
 Core system design where you design the system architecture to support the
core functionality of the system.
 Aspect identification and design Starting with the extensions identified in the
system requirements, you should analyze these to see if they are aspects in
themselves or if they should be broken down into several aspects.
 Composition design At this stage, you analyze the core system and aspect
designs to discover where the aspects should be composed with the core
system. Essentially, you are identifying the join points in a program at which
aspects will be woven.
AN ASPECT-ORIENTED DESIGN MODEL
PART OF A MODEL OF AN ASPECT
PROGRAM INSPECTION PROBLEMS
 To inspect a program (in a conventional language) effectively, you
should be able to read it from right to left and top to bottom.
 Aspects make this impossible as the program is a web rather than
a sequential document. You can’t tell from the source code where
an aspect will be woven and executed.
 Flattening an aspect-oriented program for reading is practically
impossible.
TESTING PROBLEMS WITH ASPECTS
 How should aspects be specified so that tests can be derived?
 How can aspects be tested independently of the base
system?
 How can aspect interference be tested?
 How can tests be designed so that all join points are executed
and appropriate aspect tests applied?

Weitere ähnliche Inhalte

Was ist angesagt?

Different Approaches To Sys Bldg
Different Approaches To Sys BldgDifferent Approaches To Sys Bldg
Different Approaches To Sys BldgUSeP
 
Defect Testing in Software Engineering SE20
Defect Testing in Software Engineering SE20Defect Testing in Software Engineering SE20
Defect Testing in Software Engineering SE20koolkampus
 
Ch15-Software Engineering 9
Ch15-Software Engineering 9Ch15-Software Engineering 9
Ch15-Software Engineering 9Ian Sommerville
 
Introduction to system analysis and design
Introduction to system analysis and designIntroduction to system analysis and design
Introduction to system analysis and designTwene Peter
 
Chapter17 system implementation
Chapter17 system implementationChapter17 system implementation
Chapter17 system implementationDhani Ahmad
 
Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14koolkampus
 
Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26koolkampus
 
Ch4-Software Engineering 9
Ch4-Software Engineering 9Ch4-Software Engineering 9
Ch4-Software Engineering 9Ian Sommerville
 
Lecture 12 requirements modeling - (system analysis)
Lecture 12   requirements modeling - (system analysis)Lecture 12   requirements modeling - (system analysis)
Lecture 12 requirements modeling - (system analysis)IIUI
 
Aspect Oriented Software Engineering
Aspect Oriented Software EngineeringAspect Oriented Software Engineering
Aspect Oriented Software EngineeringAbhay Pai
 
analysis and design of information system
analysis and design of information systemanalysis and design of information system
analysis and design of information systemRenu Sharma
 
System analysis and design
System analysis and design System analysis and design
System analysis and design Razan Al Ryalat
 
4.2 architecture introduction
4.2 architecture introduction4.2 architecture introduction
4.2 architecture introductioningo
 
System Analysis and Design (SAD)
System Analysis and Design (SAD)System Analysis and Design (SAD)
System Analysis and Design (SAD)Sachith Perera
 
INCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP exam
INCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP examINCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP exam
INCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP examsystemsengineeringprep
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminariesMoutasm Tamimi
 
System analysis ITM3(1).pptx
System analysis ITM3(1).pptx System analysis ITM3(1).pptx
System analysis ITM3(1).pptx Aram Mohammed
 

Was ist angesagt? (20)

Different Approaches To Sys Bldg
Different Approaches To Sys BldgDifferent Approaches To Sys Bldg
Different Approaches To Sys Bldg
 
Defect Testing in Software Engineering SE20
Defect Testing in Software Engineering SE20Defect Testing in Software Engineering SE20
Defect Testing in Software Engineering SE20
 
Ch15-Software Engineering 9
Ch15-Software Engineering 9Ch15-Software Engineering 9
Ch15-Software Engineering 9
 
Introduction to system analysis and design
Introduction to system analysis and designIntroduction to system analysis and design
Introduction to system analysis and design
 
Chapter17 system implementation
Chapter17 system implementationChapter17 system implementation
Chapter17 system implementation
 
Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14
 
Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26
 
Ch4-Software Engineering 9
Ch4-Software Engineering 9Ch4-Software Engineering 9
Ch4-Software Engineering 9
 
Lecture 12 requirements modeling - (system analysis)
Lecture 12   requirements modeling - (system analysis)Lecture 12   requirements modeling - (system analysis)
Lecture 12 requirements modeling - (system analysis)
 
System implemantation
System implemantationSystem implemantation
System implemantation
 
Aspect Oriented Software Engineering
Aspect Oriented Software EngineeringAspect Oriented Software Engineering
Aspect Oriented Software Engineering
 
Chap3 RE elicitation
Chap3 RE elicitationChap3 RE elicitation
Chap3 RE elicitation
 
analysis and design of information system
analysis and design of information systemanalysis and design of information system
analysis and design of information system
 
System analysis and design
System analysis and design System analysis and design
System analysis and design
 
4.2 architecture introduction
4.2 architecture introduction4.2 architecture introduction
4.2 architecture introduction
 
System Analysis and Design (SAD)
System Analysis and Design (SAD)System Analysis and Design (SAD)
System Analysis and Design (SAD)
 
INCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP exam
INCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP examINCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP exam
INCOSE Systems Engineering Handbook and Changes to the CSEP/ASEP exam
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
 
System analysis ITM3(1).pptx
System analysis ITM3(1).pptx System analysis ITM3(1).pptx
System analysis ITM3(1).pptx
 
Sdlc1
Sdlc1Sdlc1
Sdlc1
 

Ähnlich wie Aspect Oriented Programming - AOP/AOSD

Formal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th EditionFormal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th EditionRupeshShrestha28
 
Software Engineering Important Short Question for Exams
Software Engineering Important Short Question for ExamsSoftware Engineering Important Short Question for Exams
Software Engineering Important Short Question for ExamsMuhammadTalha436
 
System Analysis and Design Project documentation
System Analysis and Design Project documentationSystem Analysis and Design Project documentation
System Analysis and Design Project documentationMAHERMOHAMED27
 
Software testing and introduction to quality
Software testing and introduction to qualitySoftware testing and introduction to quality
Software testing and introduction to qualityDhanashriAmbre
 
Softwareenggineering lab manual
Softwareenggineering lab manualSoftwareenggineering lab manual
Softwareenggineering lab manualVivek Kumar Sinha
 
86One of the fi rst activities of an analyst is to determi.docx
86One of the fi rst activities of an analyst is to determi.docx86One of the fi rst activities of an analyst is to determi.docx
86One of the fi rst activities of an analyst is to determi.docxransayo
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering Huda Alameen
 
Project Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptxProject Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptxAjayPatre1
 
Software engineering lecture notes
Software engineering   lecture notesSoftware engineering   lecture notes
Software engineering lecture notesAmmar Shafiq
 
Ch 2-RE-process.pptx
Ch 2-RE-process.pptxCh 2-RE-process.pptx
Ch 2-RE-process.pptxbalewayalew
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering processRaheel Aslam
 
Software Engineering (Requirements Engineering & Software Maintenance)
Software Engineering (Requirements Engineering  & Software Maintenance)Software Engineering (Requirements Engineering  & Software Maintenance)
Software Engineering (Requirements Engineering & Software Maintenance)ShudipPal
 

Ähnlich wie Aspect Oriented Programming - AOP/AOSD (20)

Formal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th EditionFormal Specification Ian Sommerville 9th Edition
Formal Specification Ian Sommerville 9th Edition
 
Software Engineering Important Short Question for Exams
Software Engineering Important Short Question for ExamsSoftware Engineering Important Short Question for Exams
Software Engineering Important Short Question for Exams
 
System Analysis and Design Project documentation
System Analysis and Design Project documentationSystem Analysis and Design Project documentation
System Analysis and Design Project documentation
 
Software testing and introduction to quality
Software testing and introduction to qualitySoftware testing and introduction to quality
Software testing and introduction to quality
 
Softwareenggineering lab manual
Softwareenggineering lab manualSoftwareenggineering lab manual
Softwareenggineering lab manual
 
86One of the fi rst activities of an analyst is to determi.docx
86One of the fi rst activities of an analyst is to determi.docx86One of the fi rst activities of an analyst is to determi.docx
86One of the fi rst activities of an analyst is to determi.docx
 
Ch2
Ch2Ch2
Ch2
 
Ch2
Ch2Ch2
Ch2
 
Unit2 2
Unit2 2Unit2 2
Unit2 2
 
System development life cycle
System development life cycleSystem development life cycle
System development life cycle
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
 
Se lec 3
Se lec 3Se lec 3
Se lec 3
 
Bug Tracking Java Project
Bug Tracking Java ProjectBug Tracking Java Project
Bug Tracking Java Project
 
Project Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptxProject Documentation Student Management System format.pptx
Project Documentation Student Management System format.pptx
 
Software engineering lecture notes
Software engineering   lecture notesSoftware engineering   lecture notes
Software engineering lecture notes
 
Ch 2-RE-process.pptx
Ch 2-RE-process.pptxCh 2-RE-process.pptx
Ch 2-RE-process.pptx
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
 
Software architecture
Software architectureSoftware architecture
Software architecture
 
Software Engineering (Requirements Engineering & Software Maintenance)
Software Engineering (Requirements Engineering  & Software Maintenance)Software Engineering (Requirements Engineering  & Software Maintenance)
Software Engineering (Requirements Engineering & Software Maintenance)
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
 

Kürzlich hochgeladen

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 

Kürzlich hochgeladen (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 

Aspect Oriented Programming - AOP/AOSD

  • 1. ASPECT-ORIENTED SOFTWARE DEVELOPMENT CONTENTS 21.1 The separation of concerns 21.2 Aspects, join points, and pointcuts 21.3 Software engineering with aspects Prepared by Razık Can PAHALI, 15002697
  • 2. OBJECTIVES  Understand why the separation of concerns is a good guiding principle for software development;  Have been introduced to the fundamental ideas underlying aspects and aspect-oriented software development;
  • 3. THE SEPARATION OF CONCERNS  Organize your software so that each element in the program does one thing and one thing only.  Class, method, procedure, etc.)
  • 4.  AOSD uses a concept of horizontal slices through vertically-decomposed software components.
  • 5.
  • 6. THERE ARE SEVERAL DIFFERENT TYPES OF STAKEHOLDER CONCERN:  Functional concerns,  Quality of service concerns,  Policy concerns  System concerns,  Organizational concerns.
  • 8. • The separation of concerns is a key principle of software design and implementation. • It means that you should organize your software so that each element in the program (class, method, procedure, etc.) does one thing and one thing only. • With all this taken into account, maintenance and updating will be easier. • When changes are required, they are localized to a small number of elements
  • 9. • Although it is generally agreed that separating concerns is good software engineering practice, it is harder to pin down what is actually meant by a concern. • Sometimes it is defined as a functional notion (i.e., a concern is some element of functionality in a system). • Alternatively it may be defined as any piece of interest or focus in a program. • According to Jacobson and Ng (2004), concerns are really reflections of the system requirements and priorities of stakeholders in the system. • System requirements may be a concern ranging from users wanting a faster response time from the system to stakeholders feeling inclusion of a particular functionality is needed.
  • 10. • According to Jacobson and Ng (2004), concerns are really reflections of the system requirements and priorities of stakeholders in the system. • System requirements may be a concern ranging from users wanting a faster response time from the system to stakeholders feeling inclusion of a particular functionality is needed. • A concern can therefore be defined as something that is of interest or significance to a stakeholder or a group of stakeholders.
  • 11. • The core concerns of a system are those functional concerns that relate to its primarypurpose. • Therefore, for a hospital patient information system, the core functionalconcerns are the creation, editing, retrieval, and management of patient records. • In addition to core concerns, large systems also have secondary functional concerns. • These may involve functionality that shares information with the core concerns, or which is required so that the system can satisfy its non- functional requirements.
  • 13. • The cross cutting example in Figure 1 is based on an internet banking system. • This system has requirements relating to new users, management of existing users and management of customers. • All of these core concerns are associated with the systems primary functions- the internet baking service • However the system also has security requirements and recovery requirements. • These are cross-cutting concerns as they may influence the implementation of all of the other system requirements.
  • 14.  Programming language abstractions, such as procedures and classes, are the mechanism that you normally use to organize and structure the core concerns of a system. However, the implementation of the core concerns in conventional programming languages usually includes additional code to implement the cross-cutting, functional, quality of service, and policy concerns. This leads to two undesirable phenomena: tangling and scattering.
  • 15. • Tangling occurs when a module in a system includes code that implements different system requirements. • The related phenomenon of scattering occurs when the implementation of a single concern (a logical requirement or set of requirements) is scattered across several components in a program. • This is likely to occur when requirements related to secondary functional concerns or policy concerns are implemented.
  • 16. • Problems with scattering and tangling occur when the initial system requirements change. For example, say new statistical data had to be collected in the patient record system. • The changes to the system are not all located in one place and so you have to spend time looking for the components in the system that have to be changed. You then have to change each of these components to incorporate the required changes. • This may be expensive because of the time required to analyze the components and then make and test the changes. • There is always the possibility that you will miss some code that should be changed and so the statistics will be incorrect. • Furthermore, as several changes have to be made, this increases the chances that you will make a mistake and introduce errors into the software.
  • 18. TERMINOLOGY USED IN ASPECT-ORIENTED SOFTWARE ENGINEERING Term Definition advice The code implementing a concern. aspect A program abstraction that defines a cross-cutting concern. It includes the definition of a pointcut and the advice associated with that concern. join point An event in an executing program where the advice associated with an aspect may be executed. join point model The set of events that may be referenced in a pointcut. pointcut A statement, included in an aspect, that defines the join points where the associated aspect advice should be executed. weaving The incorporation of advice code at the specified join points by an aspect weaver.
  • 19. AN AUTHENTICATION ASPECT aspect authentication { before: call (public void update*(..)) // this is a pointcut { // this is the advice that should be executed when woven into // the executing system int tries = 0 ; string userPassword = Password.Get ( tries ); while (tries <3 && userPassword != thisUser.password ( ) ) { // allow 3 tries to get the password right tries = tries + 1 ; userPassword = Password.Get ( tries ) ; } if (userPassword != thisUser.password ( )) then //if password wrong, assume user has forgotten to logout System.Logout (thisUser.uid) ; } } // authentication
  • 20. ASPECTJ - JOIN POINT MODEL  Call events  Calls to a method or constructor  Execution events  Execution of a method or constructor  Initialisation events  Class or object initialisation  Data events  Accessing or updating a field  Exception events  The handling of an exception
  • 21. POINTCUTS  Identifies the specific events with which advice should be associated.  Examples of contexts where advice can be woven into a program  Before the execution of a specific method  After the normal or exceptional return from a method  When a field in an object is modified
  • 22. ASPECT WEAVING  Aspect weavers process source code and weave the aspects into the program at the specified pointcuts.  Three approaches to aspect weaving  Source code pre-processing  Link-time weaving  Dynamic, execution-time weaving
  • 25. TYPES OF EXTENSION o Secondary functional extensions o Policy extensions o Quality of service extensions o Infrastructure extensions
  • 26. CONCERN-ORIENTED REQUIREMENTS ENGINEERING  It’s important to separate concerns while determining the requirements engineering.  Requirements for the core system as well as requirements for the system extensions should be identified.
  • 27.
  • 28.  Apart from secondary functional requirements, there are cross- cutting concerns which reflect policy and quality of service non-functional requirements that apply to the system as a whole.  Having too many concerns or extensions to the system is not recommended as it might lead to a system design that does not conform to its quality of service requirements.
  • 29. ASPECT-ORIENTED DESIGN/PROGRAMMING  Aspect-oriented design  The process of designing a system that makes use of aspects to implement the cross-cutting concerns and extensions that are identified during the requirements engineering process.  Aspect-oriented programming  The implementation of an aspect-oriented design using an aspect-oriented programming language such as AspectJ.
  • 30. USE CASES FROM THE INVENTORY MANAGEMENT SYSTEM
  • 31. A GENERIC ASPECT-ORIENTED DESIGN PROCESS
  • 32. DESIGN ACTIVITIES  Core system design where you design the system architecture to support the core functionality of the system.  Aspect identification and design Starting with the extensions identified in the system requirements, you should analyze these to see if they are aspects in themselves or if they should be broken down into several aspects.  Composition design At this stage, you analyze the core system and aspect designs to discover where the aspects should be composed with the core system. Essentially, you are identifying the join points in a program at which aspects will be woven.
  • 34. PART OF A MODEL OF AN ASPECT
  • 35. PROGRAM INSPECTION PROBLEMS  To inspect a program (in a conventional language) effectively, you should be able to read it from right to left and top to bottom.  Aspects make this impossible as the program is a web rather than a sequential document. You can’t tell from the source code where an aspect will be woven and executed.  Flattening an aspect-oriented program for reading is practically impossible.
  • 36. TESTING PROBLEMS WITH ASPECTS  How should aspects be specified so that tests can be derived?  How can aspects be tested independently of the base system?  How can aspect interference be tested?  How can tests be designed so that all join points are executed and appropriate aspect tests applied?