SlideShare a Scribd company logo
Chapter 21 - Aspect-oriented Software Development
Lecture 1
1
Chapter 21 Aspect-oriented software engineering
Topics covered
 The separation of concerns
 Aspects, join points and pointcuts
 Software engineering with aspects
2
Chapter 21 Aspect-oriented software engineering
Aspect-oriented software development
 An approach to software development based around a
relatively new type of abstraction - an aspect.
 Used in conjunction with other approaches - normally object-
oriented software engineering.
 Aspects encapsulate functionality that cross-cuts and co-
exists with other functionality.
 Aspects include a definition of where they should be included
in a program as well as code implementing the cross-cutting
concern.
3
Chapter 21 Aspect-oriented software engineering
The separation of concerns
 The principle of separation of concerns states that software
should be organised so that each program element does one
thing and one thing only.
 Each program element should therefore be understandable
without reference to other elements.
 Program abstractions (subroutines, procedures, objects, etc.)
support the separation of concerns.
4
Chapter 21 Aspect-oriented software engineering
Concerns
 Concerns are not program issues but reflect the system
requirements and the priorities of the system stakeholders.
 Examples of concerns are performance, security, specific functionality,
etc.
 By reflecting the separation of concerns in a program, there is
clear traceability from requirements to implementation.
 Core concerns are the functional concerns that relate to the
primary purpose of a system; secondary concerns are
functional concerns that reflect non-functional and QoS
requirements.
5
Chapter 21 Aspect-oriented software engineering
Stakeholder concerns
 Functional concerns which are related to specific functionality to be
included in a system.
 Quality of service concerns which are related to the non-functional
behaviour of a system.
 Policy concerns which are related to the overall policies that govern
the use of the system.
 System concerns which are related to attributes of the system as a
whole such as its maintainability or its configurability.
 Organisational concerns which are related to organisational goals and
priorities such as producing a system within budget, making use of
existing software assets or maintaining the reputation of an
organisation.
6
Chapter 21 Aspect-oriented software engineering
Cross-cutting concerns
 Cross-cutting concerns are concerns whose implementation
cuts across a number of program components.
 This results in problems when changes to the concern have to
be made - the code to be changed is not localised but is in
different places across the system.
 Cross cutting concerns lead to tangling and scattering.
7
Chapter 21 Aspect-oriented software engineering
Cross-cutting concerns
8
Chapter 21 Aspect-oriented software engineering
Tangling of buffer management and synchronization
code
synchronized void put (SensorRecord rec )
{
// Check that there is space in the buffer; wait if not
if ( numberOfEntries == bufsize)
wait () ;
// Add record at end of buffer
store [back] = new SensorRecord (rec.sensorId,
rec.sensorVal) ;
back = back + 1 ;
// If at end of buffer, next entry is at the beginning
if (back == bufsize)
back = 0 ;
numberOfEntries = numberOfEntries + 1 ;
// indicate that buffer is available
notify () ;
} // put
9
Chapter 21 Aspect-oriented software engineering
Scattering of methods implementing secondary
concerns
10
Chapter 21 Aspect-oriented software engineering
Aspects, join points and pointcuts
 An aspect is an abstraction which implements a concern. It
includes information where it should be included in a program.
 A join point is a place in a program where an aspect may be
included (woven).
 A pointcut defines where (at which join points) the aspect will
be included in the program.
11
Chapter 21 Aspect-oriented software engineering
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.
12
Chapter 21 Aspect-oriented software engineering
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
13
Chapter 21 Aspect-oriented software engineering
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
14
Chapter 21 Aspect-oriented software engineering
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
15
Chapter 21 Aspect-oriented software engineering
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
16
Chapter 21 Aspect-oriented software engineering
Aspect weaving
17
Chapter 21 Aspect-oriented software engineering
Software engineering with aspects
 Aspects were introduced as a programming concept but, as
the notion of concerns comes from requirements, an aspect
oriented approach can be adopted at all stages in the system
development process.
 The architecture of an aspect-oriented system is based
around a core system plus extensions.
 The core system implements the primary concerns.
Extensions implement secondary and cross-cutting concerns.
18
Chapter 21 Aspect-oriented software engineering
Core system with extensions
19
Chapter 21 Aspect-oriented software engineering
Types of extension
 Secondary functional extensions
 Add extra functional capabilities to the core system
 Policy extensions
 Add functional capabilities to support an organisational policy such as
security
 QoS extensions
 Add functional capabilities to help attain quality of service requirements
 Infrastructure extensions
 Add functional capabilities to support the implementation of the system
on some platform
20
Chapter 21 Aspect-oriented software engineering
Key points
 Aspect-oriented approach to software development supports the
separation of concerns. By representing cross-cutting concerns as
aspects, individual concerns can be understood, reused and modified
without changing other parts of the program.
 Tangling occurs when a module in a system includes code that
implements different system requirements. Scattering occurs when the
implementation of a concern is scattered across several components.
 Aspects include a pointcut that defines where the aspect will be woven
into the program, and advice – the code to implement the cross-cutting
concern. Join points are events that can be referenced in a pointcut.
 To ensure the separation of concerns, systems can be designed as a core
system that implements the primary concerns of stakeholders, and a set of
extensions that implement secondary concerns.
21
Chapter 21 Aspect-oriented software engineering
Chapter 21 - Aspect-oriented Software Development
Lecture 2
22
Chapter 21 Aspect-oriented software engineering
Concern-oriented requirements engineering
 An approach to requirements engineering that focuses on
customer concerns is consistent with aspect-oriented
software development.
 Viewpoints are a way to separate the concerns of different
stakeholders.
 Viewpoints represent the requirements of related groups of
stakeholders.
 Cross-cutting concerns are concerns that are identified by all
viewpoints.
23
Chapter 21 Aspect-oriented software engineering
Viewpoints and Concerns
24
Chapter 21 Aspect-oriented software engineering
Viewpoints on an equipment inventory system
1. Emergency service users
1.1 Find a specified type of equipment (e.g., heavy lifting gear)
1.2 View equipment available in a specified store
1.3 Check-out equipment
1.4 Check-in equipment
1.5 Arrange equipment to be transported to emergency
1.6 Submit damage report
1.7 Find store close to emergency
2. Emergency planners
2.1 Find a specified type of equipment
2.2 View equipment available in a specified location
2.3 Check-in/cCheck out equipment from a store
2.4 Move equipment from one store to another
2.6 Order new equipment
25
Chapter 21 Aspect-oriented software engineering
Viewpoints on an equipment inventory system
3. Maintenance staff
3.1 Check -in/cCheck -out equipment for maintenance
3.2 View equipment available at each store
3.3 Find a specified type of equipment
3.4 View maintenance schedule for an equipment item
3.5 Complete maintenance record for an equipment item
3.6 Show all items in a store requiring maintenance
26
Chapter 21 Aspect-oriented software engineering
Availability-related requirements for the equipment
inventory system
AV.1 There shall be a ‘hot standby’ system available in a location that is
geographically well-separated from the principal system.
Rationale: The emergency may affect the principal location of the system.
AV.1.1 All transactions shall be logged at the site of the principal system and
at the remote standby site.
Rationale: This allows these transactions to be replayed and the system
databases made consistent.
AV.1.2 The system shall send status information to the emergency control
room system every five minutes.
Rationale: The operators of the control room system can switch to the hot
standby if the principal system is unavailable.
27
Chapter 21 Aspect-oriented software engineering
Inventory system - core requirements
 C.1 The system shall allow authorised users to view the
description of any item of equipment in the emergency
services inventory.
 C.2 The system shall include a search facility to allow
authorised users to search either individual inventories or the
complete inventory for a specific item or type of equipment.
28
Chapter 21 Aspect-oriented software engineering
Inventory system - extension requirements
 E1.1 It shall be possible for authorised users to place orders
with accredited suppliers for replacement items of equipment.
 E1.1.1 When an item of equipment is ordered, it should be
allocated to a specific inventory and flagged in that inventory
as ‘on order’.
29
Chapter 21 Aspect-oriented software engineering
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
Chapter 21 Aspect-oriented software engineering
Use-cases
 A use-case approach can serve as a basis for aspect-oriented
software engineering.
 Each use case represents an aspect.
 Extension use cases naturally fit the core + extensions architectural
model of a system
 Jacobsen and Ng develop these ideas of using use-cases by
introducing new concepts such as use-case slices and use
case modules.
31
Chapter 21 Aspect-oriented software engineering
Use cases from the inventory management system
32
Chapter 21 Aspect-oriented software engineering
Extension use cases
33
Chapter 21 Aspect-oriented software engineering
A generic aspect-oriented design process
34
Chapter 21 Aspect-oriented software engineering
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.
Chapter 21 Aspect-oriented software engineering 35
Design activities
 Conflict analysis and resolution Conflicts occur when there is
a pointcut clash with different aspects specifying that they
should be composed at the same point in the program.
 Name design is essential to avoid the problem of accidental
pointcuts. These occur when, at some program join point, the
name accidentally matches that in a pointcut pattern. The
advice is therefore unintentionally applied at that point.
Chapter 21 Aspect-oriented software engineering 36
UML extensions
 Expressing an aspect oriented design in the UML requires:
 A means of modelling aspects using UML stereotypes.
 A means of specifying the join points where the aspect advice is to be
composed with the core system.
37
Chapter 21 Aspect-oriented software engineering
An aspect-oriented design model
38
Chapter 21 Aspect-oriented software engineering
Part of a model of an aspect
39
Chapter 21 Aspect-oriented software engineering
Extension statement
 In the method viewItem, after the call to the method
getItemInfo, a call to the method displayHistory should be
included to display the maintenance record
Chapter 21 Aspect-oriented software engineering 40
Verification and validation
 The process of demonstrating that a program meets it
specification (verification) and meets the real needs of its
stakeholders (validation)
 Like any other systems,aspect-oriented systems can be
tested as black-boxes using the specification to derive the
tests
 However, program inspections and ‘white-box’ testing that
relies on the program source code is problematic.
 Aspects also introduce additional testing problems
41
Chapter 21 Aspect-oriented software engineering
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.
42
Chapter 21 Aspect-oriented software engineering
White box testing
 The aim of white box testing is to use source code knowledge
to design tests that provide some level of program coverage
e.g. each logical branch in a program should be executed at
least once.
 Aspect problems
 How can source code knowledge be used to derive tests?
 What exactly does test coverage mean?
43
Chapter 21 Aspect-oriented software engineering
Aspect problems
 Deriving a program flow graph of a program with aspects is
impossible. It is therefore difficult to design tests
systematically that ensure that all combinations of base code
and aspects are executed.
 What does test coverage mean?
 Code of each aspect executed once?
 Code of each aspect exeucted once at each join point where aspect
woven?
 ???
44
Chapter 21 Aspect-oriented software engineering
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?
45
Chapter 21 Aspect-oriented software engineering
Key points
 To identify concerns, you may use a viewpoint-oriented
approach to requirements engineering to elicit stakeholder
requirements and to identify cross-cutting quality of service
and policy concerns.
 The transition from requirements to design can be made by
identifying use cases, where each use case represents a
stakeholder concern.
 The problems of inspecting and deriving tests for aspect-
oriented programs are a significant barrier to the adoption of
aspect-oriented software development in large software
projects.
46
Chapter 21 Aspect-oriented software engineering

More Related Content

Similar to Ch21.pptx

Ch2
Ch2Ch2
Ch2
Limkri
 
Software Engineering Process Models
Software Engineering Process Models Software Engineering Process Models
Software Engineering Process Models
Satya P. Joshi
 
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTESSOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
suthi
 
2- THE CHANGING NATURE OF SOFTWARE.pdf
2- THE CHANGING NATURE OF SOFTWARE.pdf2- THE CHANGING NATURE OF SOFTWARE.pdf
2- THE CHANGING NATURE OF SOFTWARE.pdf
bcanawakadalcollege
 
Software process
Software processSoftware process
Software process
Jennifer Polack
 
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_SurveyPaper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_SurveyZainab Nayyar
 
SE2.ppt
SE2.pptSE2.ppt
SE2.ppt
AaMir519591
 
Fda 21 CFR 820.30 compliant software development process
Fda 21 CFR 820.30 compliant software development processFda 21 CFR 820.30 compliant software development process
Fda 21 CFR 820.30 compliant software development process
Pragmatic Cohesion Consulting, LLC
 
04_Materi Software Proses-Models(1).pptx
04_Materi Software Proses-Models(1).pptx04_Materi Software Proses-Models(1).pptx
04_Materi Software Proses-Models(1).pptx
MarwondoMarwondo
 
Ch2-2.pptx
Ch2-2.pptxCh2-2.pptx
Ch16-Software Engineering 9
Ch16-Software Engineering 9Ch16-Software Engineering 9
Ch16-Software Engineering 9Ian Sommerville
 
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
MuhammadTalha436
 
Elementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptxElementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptx
ethiouniverse
 
Software engineering study materials
Software engineering study materialsSoftware engineering study materials
Software engineering study materials
smruti sarangi
 
Chapter1
Chapter1Chapter1
Chapter1
Hoang Vu Dinh
 
Ch1-Software Engineering 9
Ch1-Software Engineering 9Ch1-Software Engineering 9
Ch1-Software Engineering 9Ian Sommerville
 
ccs356-software-engineering-notes.pdf
ccs356-software-engineering-notes.pdfccs356-software-engineering-notes.pdf
ccs356-software-engineering-notes.pdf
VijayakumarKadumbadi
 
Ian Sommerville, Software Engineering, 9th Edition Ch2
Ian Sommerville,  Software Engineering, 9th Edition Ch2Ian Sommerville,  Software Engineering, 9th Edition Ch2
Ian Sommerville, Software Engineering, 9th Edition Ch2
Mohammed Romi
 
Ch2-Software Engineering 9
Ch2-Software Engineering 9Ch2-Software Engineering 9
Ch2-Software Engineering 9Ian Sommerville
 
Mi0033
Mi0033Mi0033

Similar to Ch21.pptx (20)

Ch2
Ch2Ch2
Ch2
 
Software Engineering Process Models
Software Engineering Process Models Software Engineering Process Models
Software Engineering Process Models
 
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTESSOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
SOFTWARE ENGINEERING & ARCHITECTURE - SHORT NOTES
 
2- THE CHANGING NATURE OF SOFTWARE.pdf
2- THE CHANGING NATURE OF SOFTWARE.pdf2- THE CHANGING NATURE OF SOFTWARE.pdf
2- THE CHANGING NATURE OF SOFTWARE.pdf
 
Software process
Software processSoftware process
Software process
 
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_SurveyPaper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
 
SE2.ppt
SE2.pptSE2.ppt
SE2.ppt
 
Fda 21 CFR 820.30 compliant software development process
Fda 21 CFR 820.30 compliant software development processFda 21 CFR 820.30 compliant software development process
Fda 21 CFR 820.30 compliant software development process
 
04_Materi Software Proses-Models(1).pptx
04_Materi Software Proses-Models(1).pptx04_Materi Software Proses-Models(1).pptx
04_Materi Software Proses-Models(1).pptx
 
Ch2-2.pptx
Ch2-2.pptxCh2-2.pptx
Ch2-2.pptx
 
Ch16-Software Engineering 9
Ch16-Software Engineering 9Ch16-Software Engineering 9
Ch16-Software Engineering 9
 
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
 
Elementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptxElementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptx
 
Software engineering study materials
Software engineering study materialsSoftware engineering study materials
Software engineering study materials
 
Chapter1
Chapter1Chapter1
Chapter1
 
Ch1-Software Engineering 9
Ch1-Software Engineering 9Ch1-Software Engineering 9
Ch1-Software Engineering 9
 
ccs356-software-engineering-notes.pdf
ccs356-software-engineering-notes.pdfccs356-software-engineering-notes.pdf
ccs356-software-engineering-notes.pdf
 
Ian Sommerville, Software Engineering, 9th Edition Ch2
Ian Sommerville,  Software Engineering, 9th Edition Ch2Ian Sommerville,  Software Engineering, 9th Edition Ch2
Ian Sommerville, Software Engineering, 9th Edition Ch2
 
Ch2-Software Engineering 9
Ch2-Software Engineering 9Ch2-Software Engineering 9
Ch2-Software Engineering 9
 
Mi0033
Mi0033Mi0033
Mi0033
 

More from MohammedNouh7

JavaProgramming 17321_CS202-Chapter8.ppt
JavaProgramming 17321_CS202-Chapter8.pptJavaProgramming 17321_CS202-Chapter8.ppt
JavaProgramming 17321_CS202-Chapter8.ppt
MohammedNouh7
 
Chapter7 database management system.pptx
Chapter7 database management system.pptxChapter7 database management system.pptx
Chapter7 database management system.pptx
MohammedNouh7
 
Introduction to database m Chapter 9.pptx
Introduction to database m Chapter 9.pptxIntroduction to database m Chapter 9.pptx
Introduction to database m Chapter 9.pptx
MohammedNouh7
 
database management system lessonchapter
database management system lessonchapterdatabase management system lessonchapter
database management system lessonchapter
MohammedNouh7
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
MohammedNouh7
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptx
MohammedNouh7
 
Ch13.pptx
Ch13.pptxCh13.pptx
Ch13.pptx
MohammedNouh7
 
41slideAdvancedDatabaseProgramming.ppt
41slideAdvancedDatabaseProgramming.ppt41slideAdvancedDatabaseProgramming.ppt
41slideAdvancedDatabaseProgramming.ppt
MohammedNouh7
 
34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt
MohammedNouh7
 
11slide.ppt
11slide.ppt11slide.ppt
11slide.ppt
MohammedNouh7
 
10slide.ppt
10slide.ppt10slide.ppt
10slide.ppt
MohammedNouh7
 

More from MohammedNouh7 (11)

JavaProgramming 17321_CS202-Chapter8.ppt
JavaProgramming 17321_CS202-Chapter8.pptJavaProgramming 17321_CS202-Chapter8.ppt
JavaProgramming 17321_CS202-Chapter8.ppt
 
Chapter7 database management system.pptx
Chapter7 database management system.pptxChapter7 database management system.pptx
Chapter7 database management system.pptx
 
Introduction to database m Chapter 9.pptx
Introduction to database m Chapter 9.pptxIntroduction to database m Chapter 9.pptx
Introduction to database m Chapter 9.pptx
 
database management system lessonchapter
database management system lessonchapterdatabase management system lessonchapter
database management system lessonchapter
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptx
 
Ch13.pptx
Ch13.pptxCh13.pptx
Ch13.pptx
 
41slideAdvancedDatabaseProgramming.ppt
41slideAdvancedDatabaseProgramming.ppt41slideAdvancedDatabaseProgramming.ppt
41slideAdvancedDatabaseProgramming.ppt
 
34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt
 
11slide.ppt
11slide.ppt11slide.ppt
11slide.ppt
 
10slide.ppt
10slide.ppt10slide.ppt
10slide.ppt
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 

Ch21.pptx

  • 1. Chapter 21 - Aspect-oriented Software Development Lecture 1 1 Chapter 21 Aspect-oriented software engineering
  • 2. Topics covered  The separation of concerns  Aspects, join points and pointcuts  Software engineering with aspects 2 Chapter 21 Aspect-oriented software engineering
  • 3. Aspect-oriented software development  An approach to software development based around a relatively new type of abstraction - an aspect.  Used in conjunction with other approaches - normally object- oriented software engineering.  Aspects encapsulate functionality that cross-cuts and co- exists with other functionality.  Aspects include a definition of where they should be included in a program as well as code implementing the cross-cutting concern. 3 Chapter 21 Aspect-oriented software engineering
  • 4. The separation of concerns  The principle of separation of concerns states that software should be organised so that each program element does one thing and one thing only.  Each program element should therefore be understandable without reference to other elements.  Program abstractions (subroutines, procedures, objects, etc.) support the separation of concerns. 4 Chapter 21 Aspect-oriented software engineering
  • 5. Concerns  Concerns are not program issues but reflect the system requirements and the priorities of the system stakeholders.  Examples of concerns are performance, security, specific functionality, etc.  By reflecting the separation of concerns in a program, there is clear traceability from requirements to implementation.  Core concerns are the functional concerns that relate to the primary purpose of a system; secondary concerns are functional concerns that reflect non-functional and QoS requirements. 5 Chapter 21 Aspect-oriented software engineering
  • 6. Stakeholder concerns  Functional concerns which are related to specific functionality to be included in a system.  Quality of service concerns which are related to the non-functional behaviour of a system.  Policy concerns which are related to the overall policies that govern the use of the system.  System concerns which are related to attributes of the system as a whole such as its maintainability or its configurability.  Organisational concerns which are related to organisational goals and priorities such as producing a system within budget, making use of existing software assets or maintaining the reputation of an organisation. 6 Chapter 21 Aspect-oriented software engineering
  • 7. Cross-cutting concerns  Cross-cutting concerns are concerns whose implementation cuts across a number of program components.  This results in problems when changes to the concern have to be made - the code to be changed is not localised but is in different places across the system.  Cross cutting concerns lead to tangling and scattering. 7 Chapter 21 Aspect-oriented software engineering
  • 8. Cross-cutting concerns 8 Chapter 21 Aspect-oriented software engineering
  • 9. Tangling of buffer management and synchronization code synchronized void put (SensorRecord rec ) { // Check that there is space in the buffer; wait if not if ( numberOfEntries == bufsize) wait () ; // Add record at end of buffer store [back] = new SensorRecord (rec.sensorId, rec.sensorVal) ; back = back + 1 ; // If at end of buffer, next entry is at the beginning if (back == bufsize) back = 0 ; numberOfEntries = numberOfEntries + 1 ; // indicate that buffer is available notify () ; } // put 9 Chapter 21 Aspect-oriented software engineering
  • 10. Scattering of methods implementing secondary concerns 10 Chapter 21 Aspect-oriented software engineering
  • 11. Aspects, join points and pointcuts  An aspect is an abstraction which implements a concern. It includes information where it should be included in a program.  A join point is a place in a program where an aspect may be included (woven).  A pointcut defines where (at which join points) the aspect will be included in the program. 11 Chapter 21 Aspect-oriented software engineering
  • 12. 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. 12 Chapter 21 Aspect-oriented software engineering
  • 13. 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 13 Chapter 21 Aspect-oriented software engineering
  • 14. 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 14 Chapter 21 Aspect-oriented software engineering
  • 15. 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 15 Chapter 21 Aspect-oriented software engineering
  • 16. 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 16 Chapter 21 Aspect-oriented software engineering
  • 17. Aspect weaving 17 Chapter 21 Aspect-oriented software engineering
  • 18. Software engineering with aspects  Aspects were introduced as a programming concept but, as the notion of concerns comes from requirements, an aspect oriented approach can be adopted at all stages in the system development process.  The architecture of an aspect-oriented system is based around a core system plus extensions.  The core system implements the primary concerns. Extensions implement secondary and cross-cutting concerns. 18 Chapter 21 Aspect-oriented software engineering
  • 19. Core system with extensions 19 Chapter 21 Aspect-oriented software engineering
  • 20. Types of extension  Secondary functional extensions  Add extra functional capabilities to the core system  Policy extensions  Add functional capabilities to support an organisational policy such as security  QoS extensions  Add functional capabilities to help attain quality of service requirements  Infrastructure extensions  Add functional capabilities to support the implementation of the system on some platform 20 Chapter 21 Aspect-oriented software engineering
  • 21. Key points  Aspect-oriented approach to software development supports the separation of concerns. By representing cross-cutting concerns as aspects, individual concerns can be understood, reused and modified without changing other parts of the program.  Tangling occurs when a module in a system includes code that implements different system requirements. Scattering occurs when the implementation of a concern is scattered across several components.  Aspects include a pointcut that defines where the aspect will be woven into the program, and advice – the code to implement the cross-cutting concern. Join points are events that can be referenced in a pointcut.  To ensure the separation of concerns, systems can be designed as a core system that implements the primary concerns of stakeholders, and a set of extensions that implement secondary concerns. 21 Chapter 21 Aspect-oriented software engineering
  • 22. Chapter 21 - Aspect-oriented Software Development Lecture 2 22 Chapter 21 Aspect-oriented software engineering
  • 23. Concern-oriented requirements engineering  An approach to requirements engineering that focuses on customer concerns is consistent with aspect-oriented software development.  Viewpoints are a way to separate the concerns of different stakeholders.  Viewpoints represent the requirements of related groups of stakeholders.  Cross-cutting concerns are concerns that are identified by all viewpoints. 23 Chapter 21 Aspect-oriented software engineering
  • 24. Viewpoints and Concerns 24 Chapter 21 Aspect-oriented software engineering
  • 25. Viewpoints on an equipment inventory system 1. Emergency service users 1.1 Find a specified type of equipment (e.g., heavy lifting gear) 1.2 View equipment available in a specified store 1.3 Check-out equipment 1.4 Check-in equipment 1.5 Arrange equipment to be transported to emergency 1.6 Submit damage report 1.7 Find store close to emergency 2. Emergency planners 2.1 Find a specified type of equipment 2.2 View equipment available in a specified location 2.3 Check-in/cCheck out equipment from a store 2.4 Move equipment from one store to another 2.6 Order new equipment 25 Chapter 21 Aspect-oriented software engineering
  • 26. Viewpoints on an equipment inventory system 3. Maintenance staff 3.1 Check -in/cCheck -out equipment for maintenance 3.2 View equipment available at each store 3.3 Find a specified type of equipment 3.4 View maintenance schedule for an equipment item 3.5 Complete maintenance record for an equipment item 3.6 Show all items in a store requiring maintenance 26 Chapter 21 Aspect-oriented software engineering
  • 27. Availability-related requirements for the equipment inventory system AV.1 There shall be a ‘hot standby’ system available in a location that is geographically well-separated from the principal system. Rationale: The emergency may affect the principal location of the system. AV.1.1 All transactions shall be logged at the site of the principal system and at the remote standby site. Rationale: This allows these transactions to be replayed and the system databases made consistent. AV.1.2 The system shall send status information to the emergency control room system every five minutes. Rationale: The operators of the control room system can switch to the hot standby if the principal system is unavailable. 27 Chapter 21 Aspect-oriented software engineering
  • 28. Inventory system - core requirements  C.1 The system shall allow authorised users to view the description of any item of equipment in the emergency services inventory.  C.2 The system shall include a search facility to allow authorised users to search either individual inventories or the complete inventory for a specific item or type of equipment. 28 Chapter 21 Aspect-oriented software engineering
  • 29. Inventory system - extension requirements  E1.1 It shall be possible for authorised users to place orders with accredited suppliers for replacement items of equipment.  E1.1.1 When an item of equipment is ordered, it should be allocated to a specific inventory and flagged in that inventory as ‘on order’. 29 Chapter 21 Aspect-oriented software engineering
  • 30. 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 Chapter 21 Aspect-oriented software engineering
  • 31. Use-cases  A use-case approach can serve as a basis for aspect-oriented software engineering.  Each use case represents an aspect.  Extension use cases naturally fit the core + extensions architectural model of a system  Jacobsen and Ng develop these ideas of using use-cases by introducing new concepts such as use-case slices and use case modules. 31 Chapter 21 Aspect-oriented software engineering
  • 32. Use cases from the inventory management system 32 Chapter 21 Aspect-oriented software engineering
  • 33. Extension use cases 33 Chapter 21 Aspect-oriented software engineering
  • 34. A generic aspect-oriented design process 34 Chapter 21 Aspect-oriented software engineering
  • 35. 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. Chapter 21 Aspect-oriented software engineering 35
  • 36. Design activities  Conflict analysis and resolution Conflicts occur when there is a pointcut clash with different aspects specifying that they should be composed at the same point in the program.  Name design is essential to avoid the problem of accidental pointcuts. These occur when, at some program join point, the name accidentally matches that in a pointcut pattern. The advice is therefore unintentionally applied at that point. Chapter 21 Aspect-oriented software engineering 36
  • 37. UML extensions  Expressing an aspect oriented design in the UML requires:  A means of modelling aspects using UML stereotypes.  A means of specifying the join points where the aspect advice is to be composed with the core system. 37 Chapter 21 Aspect-oriented software engineering
  • 38. An aspect-oriented design model 38 Chapter 21 Aspect-oriented software engineering
  • 39. Part of a model of an aspect 39 Chapter 21 Aspect-oriented software engineering
  • 40. Extension statement  In the method viewItem, after the call to the method getItemInfo, a call to the method displayHistory should be included to display the maintenance record Chapter 21 Aspect-oriented software engineering 40
  • 41. Verification and validation  The process of demonstrating that a program meets it specification (verification) and meets the real needs of its stakeholders (validation)  Like any other systems,aspect-oriented systems can be tested as black-boxes using the specification to derive the tests  However, program inspections and ‘white-box’ testing that relies on the program source code is problematic.  Aspects also introduce additional testing problems 41 Chapter 21 Aspect-oriented software engineering
  • 42. 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. 42 Chapter 21 Aspect-oriented software engineering
  • 43. White box testing  The aim of white box testing is to use source code knowledge to design tests that provide some level of program coverage e.g. each logical branch in a program should be executed at least once.  Aspect problems  How can source code knowledge be used to derive tests?  What exactly does test coverage mean? 43 Chapter 21 Aspect-oriented software engineering
  • 44. Aspect problems  Deriving a program flow graph of a program with aspects is impossible. It is therefore difficult to design tests systematically that ensure that all combinations of base code and aspects are executed.  What does test coverage mean?  Code of each aspect executed once?  Code of each aspect exeucted once at each join point where aspect woven?  ??? 44 Chapter 21 Aspect-oriented software engineering
  • 45. 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? 45 Chapter 21 Aspect-oriented software engineering
  • 46. Key points  To identify concerns, you may use a viewpoint-oriented approach to requirements engineering to elicit stakeholder requirements and to identify cross-cutting quality of service and policy concerns.  The transition from requirements to design can be made by identifying use cases, where each use case represents a stakeholder concern.  The problems of inspecting and deriving tests for aspect- oriented programs are a significant barrier to the adoption of aspect-oriented software development in large software projects. 46 Chapter 21 Aspect-oriented software engineering