Advanced Topics in Software Design Post Modernism & Aspect Orientation: Advanced Separation of Concerns.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

1 Aspects of IEEE P1471 Viewpoints in Unified Modeling Language (UML) Manzur Ashraf, BRAC University Humayra Binte Ali, Dhaka University Md.Mahfuz Ashraf,
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
 Recent researches show that predicative programming can be used to specify OO concepts including classes, objects, interfaces, methods, single and multiple.
Observer Method 1. References Gamma Erich, Helm Richard, “Design Patterns: Elements of Reusable Object- Oriented Software” 2.
COS 461 Fall 1997 Transaction Processing u normal systems lose their state when they crash u many applications need better behavior u today’s topic: how.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Unified Modeling Language
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Observer Pattern Fall 2005 OOPD John Anthony. What is a Pattern? “Each pattern describes a problem which occurs over and over again in our environment,
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
IMS1805 Systems Analysis Topic 3: Doing analysis (cont from last week)
Conceptual modelling. Overview - what is the aim of the article? ”We build conceptual models in our heads to solve problems in our everyday life”… ”By.
Foundations This chapter lays down the fundamental ideas and choices on which our approach is based. First, it identifies the needs of architects in the.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
One of the course “Think About It” options Students could earn 1 through 10 points for posting a paper related to this “Think About It” box. A successful.
*Law and Coordination Rodrigo Paes. © LES/PUC-Rio Agenda Integration Coordination BPEL example Birth *Law and Coordination Further Steps.
Programming Languages and Paradigms Object-Oriented Programming.
Introduction to AOP.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Welcome to OBJECT ORIENTED PROGRAMMIN Date: 10/09/2014 Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
JAVA Introduction ● One of the main JAVA design goal is reducing complexity for programmer – Development time is half or less comparing to equivalent C++
1 N Degrees of Separation: Multi-Dimensional Separation of Concern (MDSOC) HyperJ: language and concepts of general concern combination.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Aspect Oriented Programming (AOP) in.NET Brent Krueger 12/20/13.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
Aspect Oriented Programming Scott Nykl CSSE 411 Senior Seminar.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development 1.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Introduction Better Faster Cheaper (pick any two) On-going issue that continues to motivate research in software engineering Applications: –continue to.
1 CMIS301 O-O Thinking Understanding O-O Programming by T Budd.
Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
1 Modularity Analysis of Use Case Implementations Fernanda d’Amorim Advisor: Paulo Borba.
Programming Fundamentals. Topics to be covered Today Recursion Inline Functions Scope and Storage Class A simple class Constructor Destructor.
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Basic Concepts and Definitions
Instructor: Craig Duckett Lecture 07: Tuesday, October 20 th, 2015 Conflicts and Isolation, MySQL Workbench 1 BIT275: Database Design (Fall 2015)
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Aspect-Oriented Software Development (AOSD)
Duke CPS Programming Heuristics l Identify the aspects of your application that vary and separate them from what stays the same ä Take what varies.
Basic Organization of UI Software. 2 The User Interface n Typically want to think of “UI” as only one component of an overall system – The part that “deals.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
CSCE 240 – Intro to Software Engineering Lecture 3.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
JavaScript/ App Lab Programming:
Software Engineering Lecture 7
Lecture 1 Introduction Richard Gesick.
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
JAVA Introduction ការណែនាំពី Java
Computer Programming.
Theoretical Definition Conceptual Model
Mental/Emotional Health
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Chapter 10 Thinking in Objects Part 1
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

Advanced Topics in Software Design Post Modernism & Aspect Orientation: Advanced Separation of Concerns

What is a “Concern”? A concern is… … a “kind” of functionality. … a feature, or a function of your system. … something you might worry about. Dijkstra wrote: “Let me try to explain to you, what to my taste is characteristic for all intelligent thinking. It is, that one is willing to study in depth an aspect of one’s subject matter in isolation for the sake of its own consistency, all the time knowing that one is occupying oneself only with one of the aspects. We know that a program must be correct and we can study it from that viewpoint only; we also know that is should be efficient and we can study its efficiency on another day […] But nothing is gained – on the contrary – by tackling these various aspects simultaneously. It is what I sometimes have called ‘the separation of concerns’ “

Mapping Concerns to Code Can we consider concerns separately if we can’t actually see them separately?

The ongoing need for SOC… These drawings represent the different ways the designer thinks about the structure There are far more drawings than this: Every angle is considered, every pipe is placed, Each aspect is considered separately.

Directly Representing Mental Models THE MACHINE

Separation and Abstraction

More Abstraction … More Indirection

Abstraction; Indirection Machine Specific Memory Manipulation instruction assumptions about the machine

Abstraction; Indirection Machine Specific Memory Manipulation instruction assumptions about the machine Machine Specifics Abstracted Away compiler assumptions about the machine separation of concerns

Abstraction; Indirection instruction Loops implicitly included compiler assumptions about the machine implicit looping such as “goto”

explicit loop Abstraction; Indirection instruction Loops implicitly included compiler assumptions about the machine implicit looping such as “goto” instruction Looping made explicit compiler assumptions about the machine explicit loop instruction

explicit loop instruction explicit loop instruction Abstraction; Indirection Blocks and repeated sequences implicit implicit sequence reused compiler assumptions about the machine

explicit loop instruction explicit loop instruction Abstraction; Indirection Blocks and repeated sequences implicit implicit sequence reused Blocks and repeated sequences explicit compiler assumptions about the machine subroutine/function compiler assumptions about the machine explicit loop instruction subroutine/function explicit loop instruction

Abstraction; Indirection Entities used in an unencapsulated way compiler assumptions about the machine subroutine/function explicit loop instruction subroutine/function explicit loop instruction

Abstraction; Indirection Entities used in an unencapsulated way compiler assumptions about the machine subroutine/function explicit loop instruction subroutine/function explicit loop instruction Objects encapsulate entities compiler assumptions about the machine subroutine/function explicit loop instruction subroutine/function explicit loop instruction object

The Path of Indirection… Machine Specific Memory Manipulation instruction assumptions about the machine Loops implicitly included instruction compiler assumptions about the machine explicit loop instruction explicit loop instruction Blocks and repeated sequences implicit implicit sequence reused compiler assumptions about the machine Entities used in an unencapsulated way compiler assumptions about the machine subroutine/function explicit loop instruction subroutine/function explicit loop instruction Objects encapsulate entities compiler assumptions about the machine subroutine/function explicit loop instruction subroutine/function explicit loop instruction object

So what’s next? Objects encapsulate entities compiler assumptions about the machine subroutine/function explicit loop instruction subroutine/function explicit loop instruction object what elements of our systems don’t align with objects?

Introducing Aspects… Concerns != Objects So ….There *is* functionality that doesn’t fit into an OO paradigm. There are two problems for how concerns align with objects…

A Concrete Example This transaction management concern does not fit into an OO structure. Every method that includes a transaction must have transaction management code

Tangling of Concerns apply interest manage transaction

Tangling of Concerns apply interest apply charges manage transaction

Tangling of Concerns apply interest apply charges transfer money manage transaction

What Caused the Tangling? Tangling occurs if one concern necessitates… (or in some sense “triggers”) …behavior from another concern ledger.debitInterest( ) triggers the commit acct.creditInterest( ) requires the begin

What Caused the Tangling? One object (such as the Checking account) has to play many roles.

Scattering of Concerns

What caused the Scattering? no way to unite the code related to a concern, because it deals with different entities. These entities each must be described separately, in and of themselves.

What would we want? Transaction Handling Apply Interest Deduct Charges Transfer Money We want to be able to think about each of these concerns separately, without worrying about the others. This is real “separation of concerns” as Dijkstra envisioned it.

But what do we have to overcome? Tangling: when one concern requires or triggers behavior of another concern, or when roles are mixed in an entity Scattering: when one concern is spread across many entities role-mixing

Aspects seek to overcome this… Now we’re going to go over AOP. We’ll talk first about its mechanisms for separation Then about its mechanisms for composition

What is an aspect? An aspect is a separate concern.

Different Kinds of Aspects These were encapsulated from concerns that were scattered, or whose roles were mixed within objects This was encapsulated from a concern that was triggered/required by another concern

Two Approaches for Separation Asymmetrical Captures only triggered concerns Symmetrical Captures mixed and scattered concerns Apply Interest Deduct Charges Transfer Money Transaction Handling Transaction Handling

Asymmetrical Separation Original Object-Oriented System (includes mixed and scattered concerns) Behavior that is triggered in various situations in the core core aspect

Banking: Asymmetrical Sep’n most generally associated with AspectJ from Xerox PARC

Triggered Behavior in an Aspect public aspect TransactionManagement { before(): transaction(){ transaction = new Transaction() transaction.begin() } after(): transaction(){ transaction.commit() } before and after: triggered “advice” At the Code Level

Triggered Behavior in an Aspect At Design triggered method original method

Symmetrical Separation Tangled Core

Symmetrical Separation Still have the triggered aspects But now we have separated the core to remove mixing and scattering

Separated Concerns In Design

Composition! Now that we’ve separated out everything, we need a way to tell the compiler (or whatever we’re using) how to integrate it so it can run.

Composing Symmetrical Separation

Composing Trigger Relationships

public aspect TransactionManagement { pointcut transaction: execution(*.applyCharges(..),*.applyInterest(..), *.transfer(..)) before(): transaction(){ transaction = new Transaction() transaction.begin() } after(): transaction(){ transaction.commit() } At the Code Level

Composing Trigger Relationships

Terminology TermDefinition ConcernKind of functionality AspectConcern that is “triggered” (asymmetrical) Shared- Concept Concern (base) Concern that shares conceptual elements with other concerns; not “triggered” (symmetrical) ThemeAny Concern

Now let’s try to spot concerns!