WORLD CLASS through people, technology and dedication - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

WORLD CLASS through people, technology and dedication

Description:

realization of problem domain concepts into separate units of software. Benefits of SoC ... Extend GPS Plugin (GNAT Programming System) Joinpoint model and Ada ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 28
Provided by: elis75
Learn more at: http://www.sigada.org
Category:

less

Transcript and Presenter's Notes

Title: WORLD CLASS through people, technology and dedication


1
Computer Science Software Engineering
AspectAda Aspect-Oriented Programming for Ada95
WORLD CLASS through people, technology and
dedication
2
Agenda
  • Separation of Concerns Crosscutting
  • Aspect-Oriented Programming (AOP) Model
  • Logging Example
  • AspectAda Prototype Architecture
  • Effect on SW Quality

3
Separation of Concerns (SoC)
  • Separation of Concerns (SoC) (Parnas,
    Dijkstra)
  • realization of problem domain concepts into
    separate units of software.
  • Benefits of SoC
  • Better analysis and understanding of systems
  • Easy adaptability, maintainability and high
    degree of reusability.
  • Low Coupling/High Cohesion
  • SoC Fundamental to SW Development
  • Ada95 SoC
  • Packages, Subprograms,
  • Tagged Types, Protected Types, Tasks

4
Crosscutting Concerns
  • Certain properties cannot be localized in single
    modular units, but their implementation cuts
    across the decomposition hierarchy of the system.
  • These properties are called crosscutting
    concerns, or aspects.
  • Concern (Requirement)
  • Functional
  • Non-functional
  • Design
  • Crosscutting Concern
  • A concern that is implemented in more than one
    location
  • security, logging, synchronization, fault
    tolerance, design by contract

5
Initial Picture of Crosscutting
Constantinides
6
CORBA Servant Implementation
procedure Do_Some(Self in out Object Data in
Data_t) is begin ? Tracer.Enter(Self.TraceId,
Do_Some) ? Mutex.Lock(Self.Lock) ....
-- Do business-logic --(Also invoking methods
across CORBA) .... ?Fault_Tolerance.Log_State(
Make_Stream(Data)) ?Mutex.Unlock(Self.Lock)
?Tracer.Exit(Self.TraceId, Do_Some) exception
?when event others gt ? Mutex.Unlock(Self.Loc
k) ? Error_Logger.Log_Error(event, Unknown
Exception in Do_Some) end Do_Some
7
Crosscutting identification
procedure Do_Some(Self in out Object Data in
Data_t) is begin ? Tracer.Enter(Self.TraceId,
Do_Some) ? Mutex.Lock(Self.Lock) ....
-- Do business-logic --(Also invoking methods
across CORBA) .... ?Fault_Tolerance.Log_State(
Make_Stream(Data)) ?Mutex.Unlock(Self.Lock)
?Tracer.Exit(Self.TraceId, Do_Some) exception
?when event others gt ? Mutex.Unlock(Self.Loc
k) ? Error_Logger.Log_Error(event, Unknown
Exception in Do_Some) end Do_Some
8
Symptoms of Crosscutting
  • Crosscutting imposes two symptoms on software
    development
  • Code scattering implementation of some concerns
    not well modularized but cuts across the
    decomposition hierarchy of the system.
  • Code tangling a module may contain
    implementation elements (code) for various
    concerns.
  • Problems
  • Low cohesion
  • Strong coupling
  • Low reusability, adaptability
  • Difficult comprehensibility

9
AOP Version
procedure Do_Some(Self in out Object Data in
Data_t) is begin -- Do business-logic
--(Also invoking methods across CORBA) end
Do_Some
  • Aspects
  • Tracer
  • Mutex
  • FT State
  • Exception handling
  • Composition rules
  • Rules for inserting aspect behavior to components

10
  • AOP Programming Model

11
Aspect Oriented Programming
  • AOP Complementary to OOP as OOP was to procedural
    programming
  • Also applicable to procedural programming
  • Aspect Languages extends traditional programming
    languages
  • Abstractions for representing crosscutting
    concerns (Aspects)
  • Composition of Aspects and traditional modules
    (Weaving)
  • Improves modularity, adaptability, traceability
  • AspectJ Dominant AOP language extension for
    Java
  • AspectAda Our Proposal to extend Ada95
  • Influenced by AspectJ

12
Joinpoint
  • Well defined instant in the execution of a
    program
  • Subprogram execution
  • Finalization, Initialization, Adjust (Controlled
    Types)
  • Variable access (Object declarations)
  • Package body statement block
  • Named block statements
  • Named loop statements
  • Rendezvous/Entry points

procedure Do_Some(Self in out M_Object Data
in Data_t) is ... begin ... end Do_Some
13
Pointcuts
  • Set of joinpoints (object declaration)
  • Pointcut expression (AspectJ Influenced)
  • Primitive pointcuts
  • Call
  • Execution
  • Get/Set of variables
  • Wildcard matching (, ..)
  • Composition using and, or, xor, not
  • When a pointcut is matched, an advice can be
    executed

My_PC Pointcut execution Some_Pk.Do_
(in out M_Object ..) or execution
Some_Pk.Set_ (in out M_Object ..)
14
Advice
  • Code module (as a subprogram) that attaches to a
    pointcut
  • Injects behavior at all joinpoints selected by
    that pointcut
  • Three types
  • Before (code injected before the joinpoint)
  • After (code injected after the joinpoint)
  • Around (code injected around (in place of) code
    from joinpoint

advice Around(Mutex_A in out Mutex_Aspect)
is begin Mutex_A.Mutex.Lock Proceed
Mutex_A.Mutex.Unlock when others gt
Mutex_A.Mutex.Unlock raise end Around
15
Aspect
  • A modular unit of crosscutting behavior
  • Advice type (tagged)
  • Simple (Performance)
  • Detailed (Contextual information)
  • Advice(s) bound to pointcut(s) (Advice clause)
  • Like a package can have subprograms, types ...
  • Parameterized to bind to one or more pointcut(s)

generic Mutex_P Pointcut aspect
Mutex_Aspects is type Mutex_Aspect is new
Simple_Aspect with record Mutex
Mutex_t end Mutex_Aspect advice
Around..... for AroundAdvice use Mutex_P end
Mutex_Aspects
16
  • Logging Example

17
AOP Tracing Example Aspect Spec
with AspectAda generic Tracer_P
Pointcut aspect Tracer is type Tracer_Aspect
is new Aspect_Ada.Detailed_Aspect with null
record advice Before(Tracer in
Tracer_Aspect) for BeforePointcut use
Tracer_P advice After(Tracer in
Tracer_Aspect) for AfterPointcut use
Tracer_P end Tracer
18
AOP Tracing Example Aspect Body
with Ada.Text_IO use Ada.Text_IO with
Aspect_Ada use Aspect_Ada aspect body Tracer
is advice Before(Tracer in Tracer_Aspect)
is begin Put_Line(gt
Image(Get_Join_Point(Tracer).all)) end
Before advice After(Tracer in
Tracer_Aspect) is begin Put_Line(lt
Image(Get_Join_Point(Tracer).all)) end
After end Tracer
19
AOP Tracing Example Composition Rules
with Tracer use Tracer weaver CMS_Proto is
Gun_Control_All_PC Pointcut execution
Gun.(..) aspect Gun_Control_Logger is
new Tracer_Aspect(Tracer_P gt Gun_All_PC) end
CMS_Proto
20
  • AspectAda Prototype Architecture

21
AspectAda Architecture Conceptual View
Hofmeister Notation
22
Weaver Prototype Modular View
  • ASIS Based (Ada95)
  • AdaGOOP (Aspects, Pointcuts)
  • Ada.Containers
  • Easy to adapt to Ada2005

23
  • Effects on SW Quality

24
Effects on SW Quality
  • Cohesion
  • One concern in Ada95 module
  • Crosscutting concerns modularized in aspects
  • Coupling
  • Minimal coupling modeled using pointcut
    expressions
  • Reversed dependency direction
  • Adaptability
  • Code comprehensibility
  • Tradeoff
  • Traceability

25
Future Work
  • Extended joinpoint model
  • Call, Set/Get
  • Named blocks, named loops
  • Export of context at Joinpoints (objects,
    arguments)
  • Extend GPS Plugin (GNAT Programming System)
  • Joinpoint model and Ada generics
  • Increased Aspect reusability
  • Design by contract support
  • Open for suggestions

26
Conclusion
  • Crosscutting concerns
  • Joinpoint model (joinpoints, pointcuts, advices,
    aspects)
  • Tracing using AspectAda
  • AspectAda Prototype Architecture
  • Effects on SW Quality
  • Future Work

27
End
www.cs.concordia.ca/cc/research knuthp_at_gmail.com
WORLD CLASS through people, technology and
dedication
Write a Comment
User Comments (0)
About PowerShow.com