This document discusses evolutionary problems in aspect-oriented software development. It identifies three main categories of challenges: aspect exploration, which involves discovering potential aspects in a system; aspect extraction, which involves migrating code to an aspect-oriented solution; and aspect evolution, which involves maintaining and evolving an aspect-oriented system over time. Each category presents open research problems regarding how to effectively discover, extract, and manage crosscutting concerns through the use of aspects. The document argues that addressing these problems will be important for achieving widespread adoption of aspect-oriented software development.
The composite pattern allows objects to be composed into tree structures to represent part-whole hierarchies. It allows clients to treat individual objects and compositions uniformly. The example shows how shapes like lines and rectangles can be composed into pictures. Individual shapes are leaf classes while pictures are composite classes that can group shapes together and be treated the same way as individual shapes by clients.
This document discusses interfaces in C# and .NET. It defines interfaces as collections of related members that define behaviors that classes can choose to support. It describes how to define interfaces using the interface keyword, implement interfaces in classes using a comma separated list, and obtain interface references from objects using casting, the "as" and "is" keywords. It also covers explicit interface implementation to avoid name clashes, interfaces as parameters and return types, and building interface hierarchies.
This document is from a Calculus I class at New York University. It provides an overview of functions, including the definition of a function, different ways functions can be represented (formulas, tables, graphs, verbal descriptions), properties of functions like monotonicity and symmetry, and examples of determining domains and ranges of functions. It aims to help students understand functions and their representations as a foundation for calculus.
This document contains examples and explanations of various C programming concepts related to pointers, arrays, functions and preprocessor directives. It provides code snippets to demonstrate pointer operations, passing arrays to functions, macro definitions, enumerations and for loop expressions.
This document discusses the object-oriented programming concept of polymorphism in Java. It defines polymorphism as the ability for multiple methods to have the same name but implement different behaviors depending on the object type. The document provides examples of method overloading and late binding to demonstrate polymorphism. It also discusses upcasting and downcasting between base and derived classes.
The document contains code for several engineering design problems in MATLAB. It includes code to:
1. Design a shaft given inputs of power, rpm, allowable stress, factor of safety, length, and density. It calculates the shaft diameter and weight.
2. Calculate the material saving if a hollow shaft is used instead of a solid shaft, assuming the same input parameters from the first problem.
3. The code demonstrates other engineering design problems can be solved programmatically in MATLAB, such as calculating shape dimensions based on inputs and performing structural analysis calculations.
The composite pattern allows objects to be composed into tree structures to represent part-whole hierarchies. It allows clients to treat individual objects and compositions uniformly. The example shows how shapes like lines and rectangles can be composed into pictures. Individual shapes are leaf classes while pictures are composite classes that can group shapes together and be treated the same way as individual shapes by clients.
This document discusses interfaces in C# and .NET. It defines interfaces as collections of related members that define behaviors that classes can choose to support. It describes how to define interfaces using the interface keyword, implement interfaces in classes using a comma separated list, and obtain interface references from objects using casting, the "as" and "is" keywords. It also covers explicit interface implementation to avoid name clashes, interfaces as parameters and return types, and building interface hierarchies.
This document is from a Calculus I class at New York University. It provides an overview of functions, including the definition of a function, different ways functions can be represented (formulas, tables, graphs, verbal descriptions), properties of functions like monotonicity and symmetry, and examples of determining domains and ranges of functions. It aims to help students understand functions and their representations as a foundation for calculus.
This document contains examples and explanations of various C programming concepts related to pointers, arrays, functions and preprocessor directives. It provides code snippets to demonstrate pointer operations, passing arrays to functions, macro definitions, enumerations and for loop expressions.
This document discusses the object-oriented programming concept of polymorphism in Java. It defines polymorphism as the ability for multiple methods to have the same name but implement different behaviors depending on the object type. The document provides examples of method overloading and late binding to demonstrate polymorphism. It also discusses upcasting and downcasting between base and derived classes.
The document contains code for several engineering design problems in MATLAB. It includes code to:
1. Design a shaft given inputs of power, rpm, allowable stress, factor of safety, length, and density. It calculates the shaft diameter and weight.
2. Calculate the material saving if a hollow shaft is used instead of a solid shaft, assuming the same input parameters from the first problem.
3. The code demonstrates other engineering design problems can be solved programmatically in MATLAB, such as calculating shape dimensions based on inputs and performing structural analysis calculations.
The document provides steps for graphing the cubic function f(x) = 2x^3 - 3x^2 - 12x. Step 1 analyzes the monotonicity of the function by examining the sign chart of its derivative f'(x). Step 2 analyzes concavity by examining the sign chart of the second derivative f''(x). Step 3 combines these analyses into a single sign chart summarizing the function's properties over its domain. The goal is to completely graph the function, indicating zeros, asymptotes, critical points, maxima/minima, and inflection points.
1. The document contains 12 C programming questions and their solutions ranging from calculating factorials and Fibonacci sequences to matrix operations like addition, multiplication, and inverse.
2. The questions cover basic programming concepts like loops, conditionals, functions as well as mathematical concepts like prime numbers, series, and matrix algebra.
3. The solutions provided implement the required logic to solve each problem using standard C syntax and functions.
This document discusses differentiation and defines the derivative. It begins by formally defining the derivative as a limit and then provides formulas to find the derivatives of simple functions like constants, linear functions, and power functions. It also covers numerical derivatives, implicit differentiation, and higher-order derivatives. Examples are provided to illustrate each concept.
The document discusses object-oriented programming concepts including encapsulation, inheritance, and polymorphism. It provides an example class called Point that demonstrates defining data members and member functions. It then provides a more detailed example of a Set class that implements common set operations like adding/removing elements and computing intersections/unions. The document also discusses constructors and destructors and how they are used to initialize and clean up class objects.
C++—the popular and highly readable object-oriented Programming language—is both powerful and relatively easy to learn. Whether you're new to programming or an experienced developer, this course can help you get started with C++. Er. Raushan Kumar provides an overview of the Pattern program, basic Algorithm, and an example of how to construct and run a simple C++ program.
The document discusses object-oriented programming concepts like inheritance, base classes, and derived classes. It provides code examples to illustrate inheritance relationships between classes like Point, Circle, and Cylinder. The code defines base classes like Point and derived classes like Circle that inherit properties and methods from their base classes. The examples show how to define constructors, properties, and methods in base and derived classes and call methods on derived class objects to demonstrate polymorphism.
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)Austin Benson
Tall-and-skinny Matrix Computations in MapReduce
The document discusses how to perform common matrix computations like matrix-vector multiplication (Ax), computing matrix norms (||Ax||), and factorizations like QR and SVD on tall-and-skinny matrices using MapReduce. Key strategies include distributing computations across mappers, using partial local computations to reduce communication costs, and combining results across reducers. Computing BTA is more expensive than ATA due to the need to communicate all matrix rows.
OpenGL® ES is a royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles. It consists of well-defined subsets of desktop OpenGL, creating a flexible and powerful low-level interface between software and graphics acceleration. OpenGL ES includes profiles for floating-point and fixed-point systems and the EGL™ specification for portably binding to native windowing systems. OpenGL ES 1.X is for fixed function hardware and offers acceleration, image quality and performance. OpenGL ES 2.X enables full programmable 3D graphics.
The document provides an overview of ECMAScript 6 (ES6) and Asynchronous Module Definition (AMD). It discusses features of ES6 like constants, block scoping, arrow functions, classes, and generators. It also covers using AMD modules with AngularJS and demonstrates importing and exporting modules. The presentation aims to introduce developers to ES6 and show how to use AMD modules with AngularJS applications.
The document describes the objectives of a C++ lab course. It includes:
1. Designing classes with static members, methods with default arguments, and friend functions like a matrix and vector class.
2. Implementing a complex number class with operator overloading.
3. Implementing a matrix class with dynamic memory allocation.
4. Overloading new and delete operators for custom memory allocation.
5. Developing linked list and sorting algorithm templates.
The document discusses coordinate systems and drawing in Java GUI components. It covers:
- Coordinate systems for containers, content panes, and components with the origin at the top-left.
- Using Graphics2D objects to draw on components by implementing paint() or calling getGraphics().
- Shapes, lines, rectangles, and filling objects that can be drawn.
- Dialogs for displaying information or input, including modal vs non-modal dialogs and using JOptionPane.
The document provides information about creating graphical user interface (GUI) applications in Java using Swing. It discusses creating JFrames to contain other Swing components, using classes like JLabel to add text, and handling events when the user closes the frame. It also covers drawing shapes directly by overriding the paintComponent method in a JComponent subclass and using Graphics2D to draw rectangles, lines, ellipses, and other shapes. The document demonstrates how to get user input by displaying JOptionPanes and shows an example application that draws a colored square based on RGB values entered by the user.
03 and 04 .Operators, Expressions, working with the console and conditional s...Intro C# Book
The document discusses Java syntax and concepts including:
1. It introduces primitive data types in Java like int, float, boolean and String.
2. It covers variables, operators, and expressions - how they are used to store and manipulate data in Java.
3. It explains console input and output using Scanner and System.out methods for reading user input and printing output.
4. It provides examples of using conditional statements like if and if-else to control program flow based on conditions.
The document provides an introduction and tutorial to Java 3D, a library for displaying three-dimensional graphics in Java. It covers installing Java 3D, creating a basic 3D program with a cube, adding lighting, positioning objects in 3D space using transformations, changing object appearances using materials and textures, and more. Examples of Java 3D code are provided throughout to demonstrate key concepts.
This document provides instructions for graphing linear equations. It begins with a "Do Now" activity to find and correct mistakes in a sample function table and graph. It then shows examples of graphing different linear equations by plotting points from their function tables on coordinate grids. The document concludes with a prompt to explain to an absent student how to determine from a graph if a mistake was made in a problem.
This document defines key concepts related to aspect-oriented programming (AOP) such as concerns, core concerns, cross-cutting concerns, aspects, and separation of concerns. It explains that AOP is a technique that supports cleanly separating concerns through modularization and loosely coupling components. It also discusses that aspect-oriented software development is a combination of mechanisms and methodologies to separate concerns at different abstraction levels using a combination of language, environment, and methods.
Aspect-Oriented Software Development (AOSD) is a programming methodology that addresses limitations in object-oriented programming for modularizing cross-cutting concerns. AOSD uses aspects to encapsulate cross-cutting concerns so they can be separated from the core functionality. Aspects are automatically incorporated into the system by a weaver. This improves modularity and makes software easier to maintain and evolve over time.
Aspect-oriented software development (AOSD) seeks to modularize software systems by isolating secondary concerns from the main program's logic. AOSD allows multiple concerns to be expressed separately and then automatically unified. It focuses on identifying, specifying, and representing cross-cutting concerns as separate, modular units that can be composed into a working system. Aspects encapsulate concerns and are composed of pointcuts and advice bodies. Pointcuts define where advice code should be executed.
This document summarizes key points from a lecture on aspect-oriented software development:
1. Aspect-oriented development supports separating concerns by representing cross-cutting concerns as aspects. This allows individual concerns to be understood, reused, and modified without changing other parts of the program.
2. Viewpoint-oriented requirements engineering focuses on stakeholder concerns and identifies cross-cutting concerns that affect all viewpoints.
3. Designing aspect-oriented systems involves identifying core functionality, aspects, and where aspects should be composed with the core. Testing aspect-oriented programs poses challenges around program inspection and deriving tests.
Aspect Oriented Architecture (AOA) is an effective agile development method that involves breaking down functional components into parts of the software architecture. AOA tools like AspectJ, join points, advice, and pointcuts are used to address cross-cutting concerns. AOA was applied to the Capella online learning system case study to increase workflow processes and provide a positive customer experience. While AOA allows for effective review of programming mechanisms and better understanding of cross-cutting concerns, potential disadvantages include modifications due to inconsistent tools, performance issues with some applications, and limited reuse of aspects.
The document provides steps for graphing the cubic function f(x) = 2x^3 - 3x^2 - 12x. Step 1 analyzes the monotonicity of the function by examining the sign chart of its derivative f'(x). Step 2 analyzes concavity by examining the sign chart of the second derivative f''(x). Step 3 combines these analyses into a single sign chart summarizing the function's properties over its domain. The goal is to completely graph the function, indicating zeros, asymptotes, critical points, maxima/minima, and inflection points.
1. The document contains 12 C programming questions and their solutions ranging from calculating factorials and Fibonacci sequences to matrix operations like addition, multiplication, and inverse.
2. The questions cover basic programming concepts like loops, conditionals, functions as well as mathematical concepts like prime numbers, series, and matrix algebra.
3. The solutions provided implement the required logic to solve each problem using standard C syntax and functions.
This document discusses differentiation and defines the derivative. It begins by formally defining the derivative as a limit and then provides formulas to find the derivatives of simple functions like constants, linear functions, and power functions. It also covers numerical derivatives, implicit differentiation, and higher-order derivatives. Examples are provided to illustrate each concept.
The document discusses object-oriented programming concepts including encapsulation, inheritance, and polymorphism. It provides an example class called Point that demonstrates defining data members and member functions. It then provides a more detailed example of a Set class that implements common set operations like adding/removing elements and computing intersections/unions. The document also discusses constructors and destructors and how they are used to initialize and clean up class objects.
C++—the popular and highly readable object-oriented Programming language—is both powerful and relatively easy to learn. Whether you're new to programming or an experienced developer, this course can help you get started with C++. Er. Raushan Kumar provides an overview of the Pattern program, basic Algorithm, and an example of how to construct and run a simple C++ program.
The document discusses object-oriented programming concepts like inheritance, base classes, and derived classes. It provides code examples to illustrate inheritance relationships between classes like Point, Circle, and Cylinder. The code defines base classes like Point and derived classes like Circle that inherit properties and methods from their base classes. The examples show how to define constructors, properties, and methods in base and derived classes and call methods on derived class objects to demonstrate polymorphism.
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)Austin Benson
Tall-and-skinny Matrix Computations in MapReduce
The document discusses how to perform common matrix computations like matrix-vector multiplication (Ax), computing matrix norms (||Ax||), and factorizations like QR and SVD on tall-and-skinny matrices using MapReduce. Key strategies include distributing computations across mappers, using partial local computations to reduce communication costs, and combining results across reducers. Computing BTA is more expensive than ATA due to the need to communicate all matrix rows.
OpenGL® ES is a royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles. It consists of well-defined subsets of desktop OpenGL, creating a flexible and powerful low-level interface between software and graphics acceleration. OpenGL ES includes profiles for floating-point and fixed-point systems and the EGL™ specification for portably binding to native windowing systems. OpenGL ES 1.X is for fixed function hardware and offers acceleration, image quality and performance. OpenGL ES 2.X enables full programmable 3D graphics.
The document provides an overview of ECMAScript 6 (ES6) and Asynchronous Module Definition (AMD). It discusses features of ES6 like constants, block scoping, arrow functions, classes, and generators. It also covers using AMD modules with AngularJS and demonstrates importing and exporting modules. The presentation aims to introduce developers to ES6 and show how to use AMD modules with AngularJS applications.
The document describes the objectives of a C++ lab course. It includes:
1. Designing classes with static members, methods with default arguments, and friend functions like a matrix and vector class.
2. Implementing a complex number class with operator overloading.
3. Implementing a matrix class with dynamic memory allocation.
4. Overloading new and delete operators for custom memory allocation.
5. Developing linked list and sorting algorithm templates.
The document discusses coordinate systems and drawing in Java GUI components. It covers:
- Coordinate systems for containers, content panes, and components with the origin at the top-left.
- Using Graphics2D objects to draw on components by implementing paint() or calling getGraphics().
- Shapes, lines, rectangles, and filling objects that can be drawn.
- Dialogs for displaying information or input, including modal vs non-modal dialogs and using JOptionPane.
The document provides information about creating graphical user interface (GUI) applications in Java using Swing. It discusses creating JFrames to contain other Swing components, using classes like JLabel to add text, and handling events when the user closes the frame. It also covers drawing shapes directly by overriding the paintComponent method in a JComponent subclass and using Graphics2D to draw rectangles, lines, ellipses, and other shapes. The document demonstrates how to get user input by displaying JOptionPanes and shows an example application that draws a colored square based on RGB values entered by the user.
03 and 04 .Operators, Expressions, working with the console and conditional s...Intro C# Book
The document discusses Java syntax and concepts including:
1. It introduces primitive data types in Java like int, float, boolean and String.
2. It covers variables, operators, and expressions - how they are used to store and manipulate data in Java.
3. It explains console input and output using Scanner and System.out methods for reading user input and printing output.
4. It provides examples of using conditional statements like if and if-else to control program flow based on conditions.
The document provides an introduction and tutorial to Java 3D, a library for displaying three-dimensional graphics in Java. It covers installing Java 3D, creating a basic 3D program with a cube, adding lighting, positioning objects in 3D space using transformations, changing object appearances using materials and textures, and more. Examples of Java 3D code are provided throughout to demonstrate key concepts.
This document provides instructions for graphing linear equations. It begins with a "Do Now" activity to find and correct mistakes in a sample function table and graph. It then shows examples of graphing different linear equations by plotting points from their function tables on coordinate grids. The document concludes with a prompt to explain to an absent student how to determine from a graph if a mistake was made in a problem.
This document defines key concepts related to aspect-oriented programming (AOP) such as concerns, core concerns, cross-cutting concerns, aspects, and separation of concerns. It explains that AOP is a technique that supports cleanly separating concerns through modularization and loosely coupling components. It also discusses that aspect-oriented software development is a combination of mechanisms and methodologies to separate concerns at different abstraction levels using a combination of language, environment, and methods.
Aspect-Oriented Software Development (AOSD) is a programming methodology that addresses limitations in object-oriented programming for modularizing cross-cutting concerns. AOSD uses aspects to encapsulate cross-cutting concerns so they can be separated from the core functionality. Aspects are automatically incorporated into the system by a weaver. This improves modularity and makes software easier to maintain and evolve over time.
Aspect-oriented software development (AOSD) seeks to modularize software systems by isolating secondary concerns from the main program's logic. AOSD allows multiple concerns to be expressed separately and then automatically unified. It focuses on identifying, specifying, and representing cross-cutting concerns as separate, modular units that can be composed into a working system. Aspects encapsulate concerns and are composed of pointcuts and advice bodies. Pointcuts define where advice code should be executed.
This document summarizes key points from a lecture on aspect-oriented software development:
1. Aspect-oriented development supports separating concerns by representing cross-cutting concerns as aspects. This allows individual concerns to be understood, reused, and modified without changing other parts of the program.
2. Viewpoint-oriented requirements engineering focuses on stakeholder concerns and identifies cross-cutting concerns that affect all viewpoints.
3. Designing aspect-oriented systems involves identifying core functionality, aspects, and where aspects should be composed with the core. Testing aspect-oriented programs poses challenges around program inspection and deriving tests.
Aspect Oriented Architecture (AOA) is an effective agile development method that involves breaking down functional components into parts of the software architecture. AOA tools like AspectJ, join points, advice, and pointcuts are used to address cross-cutting concerns. AOA was applied to the Capella online learning system case study to increase workflow processes and provide a positive customer experience. While AOA allows for effective review of programming mechanisms and better understanding of cross-cutting concerns, potential disadvantages include modifications due to inconsistent tools, performance issues with some applications, and limited reuse of aspects.
want to learn about Aspect-Oriented Software Development with Use Cases. These ppts will help you . Still need more info or help with any assignment related to use case visit http://www.myassignmenthelp.net/uml-assignment-help.php
The document discusses the need for a 3D modeling tool based on UML for aspect-oriented software development. It notes that current UML diagrams do not adequately represent the weaving of aspects into base models. A 3D tool could represent cross-cutting concerns as a third dimension to better track how aspects affect models during development. The document also provides background on aspect-oriented programming concepts like pointcuts, advices, and weaving, and examples of how aspects can be modeled in UML.
Introduction to Aspect Oriented Software Developmentmukhtarhudaya
The document outlines a course on aspect oriented software development, including an introduction and overview of aspect-oriented programming concepts, separation of concerns, and case studies of aspects in enterprise software. It provides details on course organization, topics that will be covered, assignments, evaluation criteria, and contact information for questions.
The document discusses various static and dynamic techniques for aspect mining, which is the process of identifying crosscutting concerns in existing source code. Static techniques discussed include fan-in analysis, clustering methods, clone detection, natural language processing analysis, and formal concept analysis. Dynamic techniques discussed include analyzing execution patterns in traces from program executions and applying formal concept analysis to execution traces. The goal of aspect mining is to facilitate migrating existing code to an aspect-oriented paradigm by identifying crosscutting concerns.
The document introduces agile software development methods. It discusses the goals of being able to speak confidently about agile and provide solutions to problems teams face. The agenda covers introductions to agile principles, roles, planning, reporting, retrospectives, and estimating. Popular agile methods like Scrum and XP are explained. The roles of product managers and product owners are compared.
public class TrequeT extends AbstractListT { .pdfinfo30292
/**
*/
public class Treque extends AbstractList {
/**
* You decide on the instance variables you need.
*/
public Treque(Class t) {
// Put your own code here
throw new UnsupportedOperationException(\"Constructor not yet implemented\");
}
public T get(int i) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here instead of throwing this exception
throw new UnsupportedOperationException(\"get(i) not yet implemented\");
}
public T set(int i, T x) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here instead of throwing this exception
throw new UnsupportedOperationException(\"set(i,x) not yet implemented\");
}
public void add(int i, T x) {
if (i < 0 || i > size()) throw new IndexOutOfBoundsException();
// Put your own code here
throw new UnsupportedOperationException(\"add(i,x) not yet implemented\");
}
public T remove(int i) {
if (i < 0 || i > size() - 1) throw new IndexOutOfBoundsException();
// Put your own code here
throw new UnsupportedOperationException(\"remove(i) not yet implemented\");
}
public int size() {
// Put your own code here
throw new UnsupportedOperationException(\"size() not yet implemented\");
}
public static void main(String[] args) {
//List tr = new ArrayDeque(Integer.class);
List tr = new Treque(Integer.class);
int K = 1000000;
Stopwatch s = new Stopwatch();
System.out.print(\"Appending \" + K + \" items...\");
System.out.flush();
s.start();
for (int i = 0; i < K; i++) {
tr.add(i);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Prepending \" + K + \" items...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.add(0, i);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Midpending(?!) \" + K + \" items...\");
System.out.flush();
s.start();
for (int i = 0; i < K; i++) {
tr.add(tr.size()/2);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the back...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(tr.size()-1);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the front...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(0);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
System.out.print(\"Removing \" + K + \" items from the middle...\");
System.out.flush();
for (int i = 0; i < K; i++) {
tr.remove(tr.size()/2);
}
s.stop();
System.out.println(\"done (\" + s.elapsedSeconds() + \"s)\");
}
}
-------------------------------------------------------------------
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.List;
/**
* This class implements the List interface using a collection of arrays of
* sizes 1, 2, 3, 4, and so on. The main advantages of this over an
* implementation like ArrayList is that there is never more than O(sqr.
This document discusses class design using inheritance and garbage collection in Java. It describes a Point class with x and y coordinates and a Rectangle class that inherits from Point and adds width and height properties. Code examples show defining the classes, creating Point and Rectangle objects, and drawing them in an applet. The Rectangle class inherits coordinate properties from Point and adds its own methods while Point's static count property tracks the number of objects.
AspectJ is a technology that allows programmers to modularize crosscutting concerns in Java programs using aspects. Aspects define pointcuts that match certain join points in the execution of a program, and advice that specifies actions to take at those join points. Pointcuts, advice, and aspects provide a way to implement crosscutting functionality separately from the core program logic.
This document discusses functions in C programming. It covers defining and declaring functions, variable scope, parameter passing, inline functions, recursive functions, function arguments, and function applications. It provides examples of function definitions and calls using integers, strings, and arrays. It explains call by value, call by address, and call by reference parameter passing. It also discusses global, private, and static variables and using the scope resolution operator.
This Java program performs optical character recognition (OCR) on image files. It allows the user to open an image file, then perform line, word, and character segmentation on the image. The program displays the original image and overlay lines, words, and character boxes as each segmentation step is performed. It uses histograms and thresholding techniques on the pixel data to identify lines, words, and characters in the image.
Aspect-oriented programming (AOP) is a programming paradigm that allows separating cross-cutting concerns into distinct modules called aspects. AspectJ is an extension to Java that implements AOP. It allows defining pointcuts that specify join points in the program flow and writing advice code to be executed at those points. Aspects modularize cross-cutting concerns like logging, profiling, and security that would otherwise be tangled throughout the codebase. AspectJ does not replace object-oriented programming but complements it by providing another way to structure programs.
Scala for Java Developers provides an overview of Scala for Java developers. It discusses:
- The goals of understanding what Scala is, learning more about it, and installing Scala.
- An introduction to Scala including what it is, its history from 1995 to 2013, and whether it is a good fit for certain uses based on its strengths like functional programming and weaknesses like syntax.
- How to get started with Scala including required and optional software and plugins.
- Key Scala features like objects, classes, traits, pattern matching, and collections.
The document contains 21 code snippets showing examples of various Java programming concepts. The code snippets cover topics such as classes and objects, inheritance, interfaces, exceptions, threads, applets, packages, input/output, and networking.
The document contains code snippets from 3 weekly coding assignments:
1) A Java program to check if a string is a palindrome. It compares characters at the beginning and end of the string.
2) A Java program to sort a list of names in ascending order using string comparison and swapping.
3) A Java program to count the frequency of words in a given text by tokenizing, sorting, and printing the words.
The document contains programs for various sorting and searching algorithms like insertion sort, selection sort, bubble sort, linear search, binary search, etc. It also includes programs for stack operations, queue operations, tower of Hanoi, infix to postfix conversion and postfix evaluation. Each program is written in C language and contains the main logic/code to implement the given algorithm or data structure operation.
Après des années d’évolution, C# continue d’évoluer dans une 6ème version que l’on peut considérer comme mineure mais qui apporte une multitude de nouveautés très utiles. Je suis prêt à parier que bon nombre d’entre vous les utiliseront tous les jours !
The document discusses an operating system and its components. It provides an overview of the Jack OS, which includes classes that provide common functions like mathematical operations, string processing, memory management, graphics, and I/O. These classes have methods that allow programs to perform tasks like drawing graphics primitives, allocating memory, and reading user input in an efficient manner by abstracting the underlying hardware. The document also discusses how some of the OS functions are implemented, such as using a memory-mapped screen for graphics and a linked list for memory allocation.
Machine-level Composition of Modularized Crosscutting Concernssaintiss
The document discusses different approaches to modularizing crosscutting concerns in software, including object-oriented programming (j), inter-type declarations (ij), aspect-oriented programming using pointcuts and advice (aj), and context-oriented programming (cj). It proposes a dedicated machine model based on objects and delegation as a core mechanism to support modularization at the machine level.
Paulo Morgado presented an overview of new features in C# 6.0. Some key points:
- The .NET Compiler Platform ("Roslyn") reimplements the C# and VB compilers in C# with public APIs.
- New C# 6.0 features include auto-property initializers, primary constructors, string interpolation, null propagation, expression-bodied members, and await in catch/finally blocks.
- Many features are still being implemented or considered for inclusion in C# 6.0 based on the April 2014 preview release.
- The presentation demonstrated examples of the new C# 6.0 language features and their syntax. Attendees were encouraged to try
The document discusses the openFrameworks 3D toolkit. It describes ofNode for 3D scene objects, ofCamera for camera functionality, ofMesh for vertex data containers, and ofEasyCam for simplified camera interaction. Examples are provided for creating a custom 3D node class that inherits from ofNode, setting up a scene with multiple custom nodes, and using ofEasyCam to follow a target node.
JAVA - Design a data structure IntSet that can hold a set of integers-.docxolsenlinnea427
JAVA - Design a data structure IntSet that can hold a set of integers. Hide the private implementation: a Binary Search Tree of Integer objects. Provide the following public methods only.
• Constructor to make an empty set,
• Constructor to create a set by initializing the root,
• void add(int x) to add x if it is not present,
• void remove(int x) to remove x if it is present,
• void print() to print all the elements currently in the set,
• boolean contains(int x) to test whether x is present,
• IntSet copy() to create a new BTS as a copy of the current one.
Note that the root of the BST is a private data member and there is no need to define getRoot(), and setRoot() functions. All the above functions should be defined public and should call recursive private functions to do the task. e.g.
// remove
private Node recRemove(Node loc, int x) { // To do }
public void remove(int x) { root= recRemove(root, x) ; }
// contains
private boolean recContains(Node loc, int x) { // to do }
public boolean contains(int x) { return recContains(root, x) ; }
Complete the class IntSet by supplying the intersection and union functions. Use the same format as above i.e. each public function calls a private recursive function to do the task:
public IntSet union(IntSet other)
public IntSet intersection(IntSet other)
Solution
import java.util.Scanner; class BinarySearchExample { public static void main(String args[]) { int counter, num, item, array[], first, last, middle; //To capture user input Scanner input = new Scanner(System.in); System.out.println(\"Enter number of elements:\"); num = input.nextInt(); //Creating array to store the all the numbers array = new int[num]; System.out.println(\"Enter \" + num + \" integers\"); //Loop to store each numbers in array for (counter = 0; counter < num; counter++) array[counter] = input.nextInt(); System.out.println(\"Enter the search value:\"); item = input.nextInt(); first = 0; last = num - 1; middle = (first + last)/2; while( first <= last ) { if ( array[middle] < item ) first = middle + 1; else if ( array[middle] == item ) { System.out.println(item + \" found at location \" + (middle + 1) + \".\"); break; } else { last = middle - 1; } middle = (first + last)/2; } if ( first > last ) System.out.println(item + \" is not found.\ \"); } }
.
OrderTest.javapublic class OrderTest { Get an arra.pdfakkhan101
OrderTest.java
public class OrderTest {
/**
* Get an array of specified size and pass it to Order.order().
* Report the results.
*/
public static void main(String[] args) {
if (args.length != 1) {//1
System.out.println(\"Usage: java OrderTest sizeOfArray\ \"
+ \"\\tor\ \\tjava OrderTest arrayFile\");
System.exit(1);
}
// create or read the int[]
int size = 0;
int[] array = new int[0];//5
try {
size = Integer.parseInt(args[0]);
array = ArrayOfInts.randomizedArray(size);
} catch (NumberFormatException nfe) {//8
try {
array = ArrayOfInts.arrayFromFile(args[0]);
size = array.length;
} catch (Exception e) {
System.err.println(\"unable to read array from \" + args[0]);
System.exit(1);//14
}
}
System.out.println(\"before:\");//15
for (int i = 0; i < array.length; i++) {//2 n
System.out.printf(((i+1) % 10 > 0) ? \" %d\" : \" %d\ \", array[i]);//1
}
int myNum = Order.order(array); //this is the call we want to measure
System.out.println(\"\ after:\");//18
for (int i = 0; i < array.length; i++) {//2 n
System.out.printf(((i+1) % 10 > 0) ? \" %d\" : \" %d\ \", array[i]);
}
System.out.println(myNum);
}
}
ArrayOfInts.java
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.InputMismatchException;
import java.util.Scanner;
public class ArrayOfInts {
/**
* Returns an array of consecutive ints from 1 to size.
*/
public static int[] orderedArray(int size) {
int[] a = new int[size];
for (int i = 0; i < size; i++) {
a[i] = i+1;
}
return a;
}
/**
* Returns a randomized array containing ints from 1 to size.
*/
public static int[] randomizedArray(int size) {
ArrayList aL = new ArrayList();
for (int i = 0; i < size; i++) {
aL.add(i+1);
}
Collections.shuffle(aL);
int[] a = new int[size];
for (int i = 0; i < size; i++) {
a[i] = aL.get(i);
}
return a;
}
/**
* Writes an int[] to a plain-text file with ints separated by spaces.
* Useful for creating input files for repeatable tests.
*/
public static void arrayToFile(int[] array, String outfile) {
try {
FileWriter fw = new FileWriter(outfile);
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter outFile = new PrintWriter(bw);
for (int i : array) {
outFile.print(i + \" \");
}
outFile.close();
} catch (IOException e) {
System.err.println(\"Could not write to \" + outfile + \"\ \" + e);
}
}
/**
* Read ints from a file and return them in an int[]
*/
public static int[] arrayFromFile(String infile) throws FileNotFoundException,
InputMismatchException {
Scanner scan = new Scanner(new File(infile));
ArrayList aL = new ArrayList();
while (scan.hasNext()) {
aL.add(scan.nextInt());
}
scan.close();
int[] a = new int[aL.size()];
for (int i = 0; i < a.length; i++) {
a[i] = aL.get(i);
}
return a;
}
}
Order.java
public class Order {
/**
* Take an int[] and reorganize it so they are in ascending order.
*/
public static int order(int[] array) .
The document provides instructions on creating and customizing Java applets. It explains that applets extend the JApplet class and must implement init(), start(), stop(), and paint() methods. It also lists Graphics methods that can be used to draw on applets and describes how to add mouse event handling.
The document contains code for a HomeAssignment class with methods to:
1) Display a square of asterisks of a given side size
2) Display a square of any character of a given side size
3) Calculate and display the factorial of a given number
4) Check if two strings are anagrams by sorting and comparing their characters.
The main method calls each method in turn to demonstrate its functionality.
The document discusses MontageJS bindings and how they can be used to define relationships between object properties. It provides examples of different types of bindings including property bindings, map bindings, and array range bindings. It also previews upcoming changes to how bindings will be defined and array operations will work.
Similar to Evolutionary Problems In Aspect Oriented Software Development (20)
These slides, covering the topics of Software Maintenance and Evolution, are introductory slides to the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium
An introductory lecture on Context-Oriented Programming, part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium. This particular lecture was made by Dr. Sebastian Gonzalez in close collaboration with Prof. Kim Mens.
Software Reuse and Object-Oriented Programmingkim.mens
These slides on Software Reuse and Object-Oriented Programming are part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium
These slides on Object-Oriented Design Heuristics are part of the course LINGI2252 “Software Maintenance and Evolution”, given by Prof. Kim Mens at UCL, Belgium.
The document discusses refactoring code to improve its internal structure without changing external behavior. It defines refactoring and provides reasons for refactoring like improving design and readability. It also categorizes different types of refactorings like decomposing methods, moving features between objects, and organizing data. Specific refactorings are explained like extract method, inline method, move method, and encapsulate field.
This presentation on Object-Oriented Application Frameworks is part of a larger course LINGI2252 on Software Maintenance and Evolution, given at UCL university in Belgium.
Towards a Context-Oriented Software Implementation Frameworkkim.mens
Context-aware systems must manage the dynamic selection, activation, and execution of feature variants according to changing contexts, detected from data gathered from their surrounding execution environment. Many context-oriented programming languages focus only on the implementation level by providing appropriate language abstractions for implementing behavioural variations that can adapt dynamically to changing contexts. They often ignore or presuppose the existence of mechanisms to deal with earlier aspects such as the gathering of sensory input and context discovery. In this presentation we discuss a layered software architecture that reconciles all these aspects in a single implementation framework, which can be customised by application programmers into actual context-aware applications. This framework and a simulator to test applications build using this framework we recently implemented in Ruby and Ruby on Rails.
Towards a Taxonomy of Context-Aware Software Variabilty Approacheskim.mens
Modern software systems demand more and more smart capabilities depending on their context of use, as well as the ability to dynamically adapt these capabilities according to sensed context changes. This requires appropriate techniques for modelling, representing and handling context-aware software variability. While traditional variability modelling approaches like feature orientation and software product lines are evolving to address the increased dynamicity and context specificity required for this new generation of software systems, new paradigms such as context-oriented programming have emerged. Although developed independently, since they address similar issues, many similarities exist between these approaches. The purpose of this work is to define, categorise and compare key concepts shared by these approaches.
Such a taxonomy is a first step towards a better understanding of the differences and similarities between different approaches for managing context-aware software variability, and to achieve a cross-fertilisation between them.
An introductory lecture on context-oriented programming, part of a full course on Programming Paradigms at UCL university in Belgium, focussing on reflection and meta programming techniques in a variety of languages. This particular lecture was made by Sebastian Gonzalez in close collaboration with Kim Mens.
This document provides an overview of reflection and metaprogramming by defining key concepts and terminology. It discusses computational systems, programs, meta systems, and meta programs. Reflection is defined as a program examining or changing its own implementation at runtime. For a system to be reflective, its concepts must be reified and it must have a causal connection between the system and what it represents. Types of reflection include introspection, structural reflection, and computational reflection. Reflective systems can be implemented using towers of interpreters or reflective architectures with meta-objects.
This document discusses advanced reflection features in Java, including dynamic proxies, call stack introspection, and instrumentation. It begins with an overview of dynamic proxies using the Proxy class and InvocationHandler interface. It then covers examining the call stack using Throwable and StackTraceElement. Finally, it describes instrumentation using the java.lang.instrument package to modify bytecode at runtime, such as logging class loads or tracing method calls. Examples are provided for each topic.
An introduction to the basics of reflection in the object-oriented programming language Java, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
An introduction to some advanced language features of the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme. This lecture looks into the Ruby features of higher-order programming (lambdas), singleton methods, mixin modules, reflection and metaprogramming.
A quick introduction to the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
A quick introduction to the object-oriented programming language Smalltalk, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
A gentle and intuitive introduction to reflection and meta programming, part of a full lecture on programming paradigms at UCL university in Belgium, with reflection and meta programming as theme. (Further lectures focus more in depth on reflection and meta programming in a variety of languages such as Smalltalk, Ruby and Java.)
Immersive Learning That Works: Research Grounding and Paths ForwardLeonel Morgado
We will metaverse into the essence of immersive learning, into its three dimensions and conceptual models. This approach encompasses elements from teaching methodologies to social involvement, through organizational concerns and technologies. Challenging the perception of learning as knowledge transfer, we introduce a 'Uses, Practices & Strategies' model operationalized by the 'Immersive Learning Brain' and ‘Immersion Cube’ frameworks. This approach offers a comprehensive guide through the intricacies of immersive educational experiences and spotlighting research frontiers, along the immersion dimensions of system, narrative, and agency. Our discourse extends to stakeholders beyond the academic sphere, addressing the interests of technologists, instructional designers, and policymakers. We span various contexts, from formal education to organizational transformation to the new horizon of an AI-pervasive society. This keynote aims to unite the iLRN community in a collaborative journey towards a future where immersive learning research and practice coalesce, paving the way for innovative educational research and practice landscapes.
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...Scintica Instrumentation
Targeting Hsp90 and its pathogen Orthologs with Tethered Inhibitors as a Diagnostic and Therapeutic Strategy for cancer and infectious diseases with Dr. Timothy Haystead.
When I was asked to give a companion lecture in support of ‘The Philosophy of Science’ (https://shorturl.at/4pUXz) I decided not to walk through the detail of the many methodologies in order of use. Instead, I chose to employ a long standing, and ongoing, scientific development as an exemplar. And so, I chose the ever evolving story of Thermodynamics as a scientific investigation at its best.
Conducted over a period of >200 years, Thermodynamics R&D, and application, benefitted from the highest levels of professionalism, collaboration, and technical thoroughness. New layers of application, methodology, and practice were made possible by the progressive advance of technology. In turn, this has seen measurement and modelling accuracy continually improved at a micro and macro level.
Perhaps most importantly, Thermodynamics rapidly became a primary tool in the advance of applied science/engineering/technology, spanning micro-tech, to aerospace and cosmology. I can think of no better a story to illustrate the breadth of scientific methodologies and applications at their best.
The cost of acquiring information by natural selectionCarl Bergstrom
This is a short talk that I gave at the Banff International Research Station workshop on Modeling and Theory in Population Biology. The idea is to try to understand how the burden of natural selection relates to the amount of information that selection puts into the genome.
It's based on the first part of this research paper:
The cost of information acquisition by natural selection
Ryan Seamus McGee, Olivia Kosterlitz, Artem Kaznatcheev, Benjamin Kerr, Carl T. Bergstrom
bioRxiv 2022.07.02.498577; doi: https://doi.org/10.1101/2022.07.02.498577
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...Advanced-Concepts-Team
Presentation in the Science Coffee of the Advanced Concepts Team of the European Space Agency on the 07.06.2024.
Speaker: Diego Blas (IFAE/ICREA)
Title: Gravitational wave detection with orbital motion of Moon and artificial
Abstract:
In this talk I will describe some recent ideas to find gravitational waves from supermassive black holes or of primordial origin by studying their secular effect on the orbital motion of the Moon or satellites that are laser ranged.
PPT on Direct Seeded Rice presented at the three-day 'Training and Validation Workshop on Modules of Climate Smart Agriculture (CSA) Technologies in South Asia' workshop on April 22, 2024.
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdfSelcen Ozturkcan
Ozturkcan, S., Berndt, A., & Angelakis, A. (2024). Mending clothing to support sustainable fashion. Presented at the 31st Annual Conference by the Consortium for International Marketing Research (CIMaR), 10-13 Jun 2024, University of Gävle, Sweden.
The technology uses reclaimed CO₂ as the dyeing medium in a closed loop process. When pressurized, CO₂ becomes supercritical (SC-CO₂). In this state CO₂ has a very high solvent power, allowing the dye to dissolve easily.
Authoring a personal GPT for your research and practice: How we created the Q...Leonel Morgado
Thematic analysis in qualitative research is a time-consuming and systematic task, typically done using teams. Team members must ground their activities on common understandings of the major concepts underlying the thematic analysis, and define criteria for its development. However, conceptual misunderstandings, equivocations, and lack of adherence to criteria are challenges to the quality and speed of this process. Given the distributed and uncertain nature of this process, we wondered if the tasks in thematic analysis could be supported by readily available artificial intelligence chatbots. Our early efforts point to potential benefits: not just saving time in the coding process but better adherence to criteria and grounding, by increasing triangulation between humans and artificial intelligence. This tutorial will provide a description and demonstration of the process we followed, as two academic researchers, to develop a custom ChatGPT to assist with qualitative coding in the thematic data analysis process of immersive learning accounts in a survey of the academic literature: QUAL-E Immersive Learning Thematic Analysis Helper. In the hands-on time, participants will try out QUAL-E and develop their ideas for their own qualitative coding ChatGPT. Participants that have the paid ChatGPT Plus subscription can create a draft of their assistants. The organizers will provide course materials and slide deck that participants will be able to utilize to continue development of their custom GPT. The paid subscription to ChatGPT Plus is not required to participate in this workshop, just for trying out personal GPTs during it.
Authoring a personal GPT for your research and practice: How we created the Q...
Evolutionary Problems In Aspect Oriented Software Development
1. Evolutionary Problems
in Aspect-Oriented
Software Development
Pr. Kim Mens
Inspired by and based on:
Dr. Tom Tourwé
K. MENS & T. TOURWE.
Evolution Issues in Aspect-Oriented Programming.
Chapter in book on quot;Software Evolutionquot;,
edited by T. Mens & S. Demeyer, pp. 197–224.
In press. Springer, 2008.
1
2. Goal
Identify some “evolution issues” in AOSD
– challenges that adopters of AO technology may face
– research problems remaining to be explored
Three main categories:
– aspect exploration : discovering potential aspects
– aspect extraction : migrating to AO solution
– aspect evolution : maintaining and evolution of AO system
Aspect
Evolution
BASE system
Aspect Aspect
LEGACY system LEGACY system
Exploration Extraction
Aspect
Aspect Aspect
2
2
3. The AOP Idea
aspect 3
aspect 1 aspect 2
Aspect
Weaver
core application functionality
woven output code
3
3
4. class Point extends Shape {
public void setX(int x) throws IllegalArgumentException {
if ( x < MIN_X || x > MAX_X )
throw new IllegalArgumentException(quot;x is out of bounds.quot;);
...
Tangled
}
with base
public void setY(int y) throws IllegalArgumentException {
if ( y < MIN_Y || y > MAX_Y )
code
throw new IllegalArgumentException(quot;y is out of bounds.quot;);
...
}
} class FigureElement extends Shape {
public void setXY(int, int) throws IllegalArgumentException {
if ( x < MIN_X || x > MAX_X )
Scattered throw new IllegalArgumentException(quot;x is out of bounds.quot;);
if ( y < MIN_Y || y > MAX_Y )
concern throw new IllegalArgumentException(quot;y is out of bounds.quot;);
...
}
}
4
4
5. aspect PointBoundsChecking {
Aspect
pointcut setX(int x):
(execution(void FigureElement.setXY(int, int)) && args(x, *))
|| (execution(void Point.setX(int)) && args(x));
before(int x): setX(x) {
if ( x < MIN_X || x > MAX_X )
class Point extends Shape {
throw new IllegalArgumentException(quot;x is out of bounds.quot;);
}
public void setX(int x) {
...
pointcut setY(int y):
}
(execution(void FigureElement.setXY(int, int)) && args(*, y))
public void setY(int y) {
|| (execution(void Point.setY(int)) && args(y));
...
}
before(int y): setY(y) {
}
if ( y < MIN_Y || y > MAX_Y )
throw new IllegalArgumentException(quot;y is out of bounds.quot;);
class FigureElement extends Shape {
}
}
public void setXY(int, int) {
...
Base code }
} 5
5
7. Aspect Exploration
Problem: how to discover potential aspect
candidates in a (legacy) system
Issues:
– how are crosscutting concerns implemented?
• taxonomy of sorts needed
– what crosscutting concerns can be discovered?
• can only trivial concerns be detected
– how do crosscutting concerns affect software quality?
• assess the need for extracting them into aspects
– how to find the crosscutting concerns in the code?
• precision / recall / coverage
7
7
10. Aspect Extraction
Problem: how to extract discovered aspect
candidates into real aspects?
Issues:
– how to separate crosscutting concerns from base code?
• depends on how tangled the code is
– how to determine appropriate joinpoints for the aspects?
• aspect languages impose limitations on kinds of joinpoints
– how to determine appropriate pointcuts for the aspects?
• prefer intensional pointcuts over extensional ones
– how to determine appropriate advice code?
• modifications required due to changing context, and due to
small variations in the scattered code 10
10
11. enclosing method, an after-advice is used instead
and describe 7 extraction transformations with the particular pointcuts they
before-advice.
ample, they define an Extract Before Call transformation, depicted in Figure
The second refactoring deals with the following c
Refactoringcode that callThehoccursoccurstowithin the execution call.method asp
Crosscuttingmoved method of before/aft
Concerns f.
a block of always before a particular In the
cut p intercepts the to that
call/block be is always
into Aspects
reintroduces the call to g at the proper execution point.
another call.
Kim Mens and Tom Tourw´
e
class A {
f
int x = 0;
void f(C c) {
class A {
x++;
int x = 0;
α (CB) this.g(); ω()
this .g();
void f(C c) {
c.h();
x++;
if (x > 0)
f
c.h();
g
x = 0;
} if (x > 0)
} x = 0;
}
}
aspect B {
aspect B {
pointcut p(A a):
pointcut p(A a):
f
execution(void A.f(C)) &&
execution(void A.f(C)) &&
g aspect
this(a) && call(void C.h());
this(a) && call(void C.h());
before(A a): p(a) { { a.g();} }
before(A a): p(a) a.g();
}
}
Figure 6. Callan
Applying Before.
Fig. 9.6: Making code aspect friendly
Making code Fig. 9.7: The Extract Before Call transformation
“extract before call”
aspect-friendly Figure 6 shows the code transformation produced
refactoring
Another alternative is to restructure the code before extracting the crosscutting concern
e, to make it fit the joinpoint model offered by the AOP language. This is the approach aspect B, the pointcut p intercepts 11
Before. In the the
en by both Binkley et al [458] and Monteiro and Fernandes [455], who suggest to apply
h that occurs within the execution of method f. 11 A
itional refactorings first in order to make the codeAlthough not explained explicitly in the paper, it is clear that applying
more “aspect friendly”. For example,
12. Aspect Evolution
Problem: how to manage the evolution of an
aspect-oriented problem?
Issues:
– how to assess the impact on the aspects when the base
system evolves?
• base system is oblivious of the aspects
– how to manage evolution of the aspects themselves?
• to make the more abstract, more reusable, less brittle, ...
– how to deal with interacting and conflicting aspects?
• two aspects can work well independently but cause problems
when combined
Aspect evolution paradox
12
12
13. Fragile Pointcut Problem
*/
*/
public class FileDownload {
public class FileDownload {
public static
import java.io.*;
public static
import java.io.*; import java.util.zip.*;
void download(String address,
void download(String address,
import java.util.zip.*;
String localFileName) {
/**
String localFileName) {
/** * Command line program to copy a file to
* Command line program to copy a file to another directory.
OutputStream
another directory. * @author Marco Schmidt
OutputStream out
* @author Marco Schmidt */
out = null;
= null;
*/ public class CopyFile {
public class CopyFile {
// constant values for
// constant values for the override option
URLConnection
URLConnection
the override option
public static final
conn = null;
public static final int int OVERWRITE_ALWAYS = 1;
conn = null;
OVERWRITE_ALWAYS = 1;
public static final
public static final int int OVERWRITE_NEVER = 2;
InputStream
OVERWRITE_NEVER = 2;
public static final
InputStream in
public static Long createChecksum(File file)
public static final int int OVERWRITE_ASK = 3;
public static Long createChecksum(File
throws IOException {
= null;
OVERWRITE_ASK = 3;
file) throws IOException {
long millis =
// program options
long millis =
System.currentTimeMillis();
// program options initialized to default values System.currentTimeMillis();
InputStream in = new
initialized to default values
private static int
InputStream in =
FileInputStream(file);
*/
private static int bufferSize = 4 * 1024; new FileInputStream(file);
bufferSize = 4 * 1024;
*/
private static boolean
public class HappyNewYear
byte[] buffer = new
private static boolean clock = true;
byte[] buffer =
public class HappyNewYear byte[bufferSize];
implements Runnable
clock = true;
private static boolean new byte[bufferSize];
private static boolean
implements Runnable copyOriginalTimestamp = true;
{
copyOriginalTimestamp = true;
private static boolean
{
private static boolean verify = true;
verify = true;
private static int
private static NumberFormat
private static int override = OVERWRITE_ASK;
private static NumberFormat formatter =
override = OVERWRITE_ASK;
formatter =
public static Long
public static Long copyFile(File srcFile, File destFile)
NumberFormat.getInstance();
copyFile(File srcFile, File destFile)
throws IOException {
throws IOException {
private JFrame frame;
InputStream in = new
InputStream in = new FileInputStream(srcFile);
FileInputStream(srcFile);
private JLabel label;
OutputStream out = new
OutputStream out = new FileOutputStream(destFile);
*/
FileOutputStream(destFile);
private long newYearMillis;
long millis =
public class FileDownload {
long millis = System.currentTimeMillis();
public static
System.currentTimeMillis();
private String message;
CRC32 checksum = null;
void download(String address,
CRC32 checksum = null;
String localFileName) {
if (verify) {
if (verify) {
public HappyNewYear(JFrame
OutputStream
checksum = new CRC32();
checksum = new
frame, JLabel label)
CRC32();
out = null;
checksum.reset();
}
{
checksum.reset();
URLConnection
byte[] buffer = new
conn = null;
byte[bufferSize];
}
// store argument GUI
byte[] buffer = new
InputStream
byte[bufferSize];
elements
int bytesRead;
while ((bytesRead =
this.frame = frame; in.read(buffer)) >= 0) {
if (verify) {
evolution
Pointcuts in program Pointcuts in evolved program
tal
den miss
i
acc int
po
join
ded e
ten aptur
n
uni int c
po
join
Class Class
Name Class Name Class
Class Attributes Name Attributes Name
Name Attributes Attributes Attributes Attributes
Attributes 1
Operations Attributes Operations Attributes
1
*
Attributes Class Class
1 Operations Operations Operations Operations
*
1 1
Operations Name Name
Operations Operations
*
Operations * Attributes Attributes
* Class Class Attributes Attributes
Name Name Operations Operations
Class
Attributes Attributes Operations Operations
Name
Attributes Attributes
Attributes
Operations Operations Class
Class Attributes
Operations Operations Name
Name Operations
Attributes
Attributes Operations
Attributes
Attributes
Operations
Source program Evolved Source program
Operations
Operations
Operations
13
13
14. Conclusion
AO is a very interesting area for software
evolution researchers to explore
– not only AOP but AOSD in general (e.g. “early aspects”)
– many open evolution problems and issues to explore
– in order to achieve widespread adoption of AOSD
– some problems can reuse existing evolution research
– other problems require dedicated solutions
– it’s not too late to jump on the train...
14
14