Cross cutting Cross-cutting of components and aspects ordinary program structure-shy functionality structure synchronization better program Components.

Slides:



Advertisements
Similar presentations
Web Design & Development Lecture 19. Java Graphics 2.
Advertisements

Graphics Graphics Java Vectors Java Enumeration Graphical Spreadsheets
The Point Class public class Point { public double x; public double y; public Point(double x0, double y0) { x = x0; y = y0; } public double distance(Point.
Inheritance // A simple class hierarchy. // A class for two-dimensional objects. class TwoDShape { double width; double height; void showDim() { System.out.println("Width.
Pointers Prasun Dewan Comp 114.
INTERFACES IN JAVA 1.Java Does not support Multiple Inheritance directly. Multiple inheritance can be achieved in java by the use of interfaces. 2.We need.
Esempio Polimorfismo1 // Definition of abstract base class Shape #ifndef SHAPE_H #define SHAPE_H class Shape { public: virtual double area() const { return.
Controlling the Complexity of Software Designs Karl Lieberherr College of Computer and Information Science Northeastern University.
Exercises on Basic OOP TCP1201: 2013/2014. Catch the Bug 1 class Point { private : int x, y; public : Point(int u, int v) : x(u), y(v) { } int getX()
More Inheritance and LSP CS340100, NTHU Yoshi. More about Inheritance Reuse? – Q1: 你有沒有程式 ” 砍掉重練 ” 的經驗 ? – Q2: 你有沒有 ” 再造輪子 ” 的經驗 ? class Rectangle – Firstly,
CSE 2501 Review Declaring a variable allocates space for the type of datum it is to store int x; // allocates space for an int int *px; // allocates space.
1 Lecture 06(Abstract Classes)Lecture 9 Abstract Classes Overview  Abstract Classes: A Definition.  Declaring Abstract Classes.  Abstract Methods: A.
Software modularity group Gregor Kiczales Professor and NSERC/Xerox/Sierra Systems Software Design Chair University of British Columbia Principal Scientist.
Inheritance Is a form of software reusability in which programmers create classes that absorb an existing class’s data and behaviors and enhance them with.
1 Features of Java CS 3331 Fall Outline  Abstract class  Interface  Application --- animation applets.
1 Data Structures - CSCI 102 CS102 C++ Polymorphism Prof Tejada.
Controlling the Complexity of Software Designs Karl Lieberherr College of Computer and Information Science Northeastern University.
Week 3 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Demeter and Aspects1 AOSD 2002 Tutorial: Demeter Aspect-Oriented Programming of Traversal Related Concerns in Java Demeter Research Group.
C OMP 110/401 C OMPOSITE A NNOTATIONS Instructor: Prasun Dewan.
Controlling the Complexity of Software Designs Karl Lieberherr College of Computer and Information Science Northeastern University.
Take-Home Final COM 3205 Fall Stamp Coupling Def: data structure is passed as parameter, but called method operates on only some of the` individual.
CSC 205 Java Programming II Polymorphism. Topics Polymorphism The principle of substitution Dynamic binding Object type casting Abstract class The canonical.
Aspect Oriented Programming Gülşah KARADUMAN.
Kiczales and Mezini - FOAL AOP and Modular Reasoning [ICSE05] Start with first-principles definition of modularity and modular reasoning –localization,
-Sai Phalgun Tatavarthy. Outline What is a “Graphing Calculator”? Graphics, Graphics2D classes Methods of Graphics object Custom Painting The paintComponent()
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 Reducing synchronization.
The following viewgraphs about RIDL from: D: A Framework for Distributed Programming Cristina Videira Lopes.
Aspect-Oriented Programming and Modular Reasoning G. KiczalesM. Mezini Presented by Alex Berendeyev.
Copyright (c) 1998, 1999 D.L. Bailey * Winter 1999 Part 6 Reusing Classes: Inheritance and Composition.
Software Design Principles
1 XAspects An Extensible System for Domain- Specific Aspect Languages Macneil Shonle (UCSD) Karl Lieberherr (Northeastern University) Ankit Shah (Northeastern.
1 Modularization of crosscutting concerns Write this public class Shape { protected double x_= 0.0, y_= 0.0; protected double width_=0.0, height_=0.0;
 2003 Prentice Hall, Inc. All rights reserved Case Study: Three-Level Inheritance Hierarchy Three level point/circle/cylinder hierarchy –Point.
Controlling the Complexity of Software Designs Karl Lieberherr College of Computer and Information Science Northeastern University.
Controlling the Complexity of Software Designs Karl Lieberherr College of Computer and Information Science Northeastern University.
Controlling the Complexity of Software Designs Karl Lieberherr College of Computer and Information Science Northeastern University.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
Classes Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Inheritance CSI 1101 Nour El Kadri. OOP  We have seen that object-oriented programming (OOP) helps organizing and maintaining large software systems.
XAspects slides Cross-cutting of concerns ordinary program structure-shy functionality structure synchronization better program Chapter 1 Chapter 2 Chapter.
C# - Inheritance Ashima Wadhwa. Inheritance One of the most important concepts in object- oriented programming is inheritance. Inheritance allows us to.
Copyright 1997, 1998 Xerox Corporation - Dijkstra, A discipline of programming, 1976 last chapter, In retrospect “To my taste the main characteristic of.
Powerpoint slides from A+ Computer Science Modified by Mr. Smith for his course.
This computer science resource was developed through a collaboration between IBM Corporation and CSTA. 1 Lesson 2: Pong Class Design.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 10 - Object-Oriented Programming: Polymorphism.
Yingcai Xiao Programming and Debugging in Unity Yingcai Xiao.
Powerpoint slides from A+ Computer Science Modified by Mr. Smith for his course.
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
Programming and Debugging
OOP Powerpoint slides from A+ Computer Science
Controlling the Complexity of Software Designs
Inheritance "Question: What is the object oriented way of getting rich? Answer: Inheritance.“ “Inheritance is new code that reuses old code. Polymorphism.
Controlling the Complexity of Software Designs
Northeastern University, CCIS/PRL
null, true, and false are also reserved.
Software Design and Development
Karl Lieberherr CCIS/PRL Northeastern University
Building Modular Object-Oriented Systems with Reusable Collaborations
Sustainable Software Karl Lieberherr Northeastern University
Programming and Debugging
Virtual Functions Example
Software Development CSU 670 Karl Lieberherr
Declarative Techniques for Improving Aspect Orthogonality
College of Computer Science
Overview Structure-shy Object pattern
Millennium High School Agenda Calendar
Key Concepts from 1301: What you should already know
Coordination aspect Review of AOP Summary of threads in Java
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Cross cutting

Cross-cutting of components and aspects ordinary program structure-shy functionality structure synchronization better program Components Aspect 1 Aspect 2

From Crista Lopes PhD thesis (NU/Xerox PARC) Write this public class Shape { protected double x_= 0.0, y_= 0.0; protected double width_=0.0, height_=0.0; double get_x() { return x_(); } void set_x(int x) { x_ = x; } double get_y() { return y_(); } void set_y(int y) { y_ = y; } double get_width(){ return width_(); } void set_width(int w) { width_ = w; } double get_height(){ return height_(); } void set_height(int h) { height_ = h; } void adjustLocation() { x_ = longCalculation1(); y_ = longCalculation2(); } void adjustDimensions() { width_ = longCalculation3(); height_ = longCalculation4(); } coordinator Shape { selfex adjustLocation, adjustDimensions; mutex {adjustLocation, get_x, set_x, get_y, set_y}; mutex {adjustDimensions, get_width, get_height, set_width, set_height}; } portal Shape { double get_x() {} ; void set_x(int x) {}; double get_y() {}; void set_y(int y) {}; double get_width() {}; void set_width(int w) {}; double get_height() {}; void set_height(int h) {}; void adjustLocation() {}; void adjustDimensions() {}; } Instead of writing this public class Shape implements ShapeI { protected AdjustableLocation loc; protected AdjustableDimension dim; public Shape() { loc = new AdjustableLocation(0, 0); dim = new AdjustableDimension(0, 0); } double get_x() throws RemoteException { return loc.x(); } void set_x(int x) throws RemoteException { loc.set_x(); } double get_y() throws RemoteException { return loc.y(); } void set_y(int y) throws RemoteException { loc.set_y(); } double get_width() throws RemoteException { return dim.width(); } void set_width(int w) throws RemoteException { dim.set_w(); } double get_height() throws RemoteException { return dim.height(); } void set_height(int h) throws RemoteException { dim.set_h(); } void adjustLocation() throws RemoteException { loc.adjust(); } void adjustDimensions() throws RemoteException { dim.adjust(); } class AdjustableLocation { protected double x_, y_; public AdjustableLocation(double x, double y) { x_ = x; y_ = y; } synchronized double get_x() { return x_; } synchronized void set_x(int x) {x_ = x;} synchronized double get_y() { return y_; } synchronized void set_y(int y) {y_ = y;} synchronized void adjust() { x_ = longCalculation1(); y_ = longCalculation2(); } class AdjustableDimension { protected double width_=0.0, height_=0.0; public AdjustableDimension(double h, double w) { height_ = h; width_ = w; } synchronized double get_width() { return width_; } synchronized void set_w(int w) {width_ = w;} synchronized double get_height() { return height_; } synchronized void set_h(int h) {height_ = h;} synchronized void adjust() { width_ = longCalculation3(); height_ = longCalculation4(); } interface ShapeI extends Remote { double get_x() throws RemoteException ; void set_x(int x) throws RemoteException ; double get_y() throws RemoteException ; void set_y(int y) throws RemoteException ; double get_width() throws RemoteException ; void set_width(int w) throws RemoteException ; double get_height() throws RemoteException ; void set_height(int h) throws RemoteException ; void adjustLocation() throws RemoteException ; void adjustDimensions() throws RemoteException ; }

Z customer service center teller service self-service C1 C2 C3 C4 C5 Collab-1 Collab-2Collab-3 Collab-4 C1 C2 C3 C4 C5 OOAD Implementation

Reconciliation of Both Worlds: Adaptive Plug-n-Play Components (APPC)