280 likes | 465 Views
Aspect Oriented Software Development. By: Mostafa El Barbary. On July 20 th 2008, our name has changed from to. Objectives. To explain the principle of separation of concerns in software development To introduce the fundamental ideas underlying aspect-oriented development
E N D
Aspect Oriented Software Development By: Mostafa El Barbary
Objectives • To explain the principle of separation of concerns in software development • To introduce the fundamental ideas underlying aspect-oriented development • To show how an aspect-oriented approach can be used at all stages of development
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Introduction • A concern is an area of interest or focus in a system. Concerns are the primary criteria for decomposing software into smaller, more manageable and comprehensible parts that have meaning to a software engineer. • Object-oriented programming, describing concerns as objects • Procedural programming, describing concerns as procedures
Introduction • Separation of concerns (SOC) The principle of separation of concerns states that software should be organized so that each program element does one thing and one thing only. • Each program element should therefore be understandable without reference to other elements. • Object-oriented programming languages such as Java can separate concerns into objects. • Service-oriented architecture can separate concerns into services. • Procedural programming languages such as C and Pascal can separate concerns into procedures.
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Problem Statement Transfer Concern Authentication Concern Logging Concern TransactionConcern
Problem Statement Banking System Transfer Concern Cash Deposit Concern Authentication Concern Authentication Concern Logging Concern Logging Concern Transaction Concern Transaction Concern Cash Withdrawal Concern Authentication Concern Logging Concern Transaction Concern
Problem Statement • Code is scattered when one concern (like logging) is spread over a number of modules (e.g., Transfer method). • Modules end up tangled with multiple concerns (e.g., Transfer, logging, and Authentication).
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Aspect Solution • AOSD attempts to solve this problem by allowing the programmer to express cross-cutting concerns (e.g., Transaction, logging, and Authentication) in stand-alone modules called aspects. • 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.
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Aspect Anatomy aspect authentication //this is the aspect { before: call (public void Transfer (..)) // this is a pointcut { // this is the advice 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
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Aspect Weaving • Aspect weavers process source code and weave the aspects into the program at the specified pointcuts.
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Agenda Introduction Problem Statement Aspect Solution Aspect Anatomy Aspect Terminology Aspect Weaving Evolution of Systems Development Methods Aspect Oriented Software Development
Aspect Oriented Software Development • A holistic approach to developing software systems with aspects. • Better modularity for functional requirements, nonfunctional requirements, platform specifics, and so on and keeping them separate from each other. • AOSD is not just AOP. It encompasses a whole range of techniques to help you achieve better modularity. • object orientation • component-based development • design patterns • object-oriented frameworks such as J2EE and .NET, and more
Aspect Oriented Software Development ... Requirements Engineering ... Architecture ... Design Aspect-oriented... ... Programming ... Verification techniques
Mostafa Elbarbary 012-428-6547 Mostafa.elbarbary@its.ws