ArchJava A software architecture tool –components –connections –constraints on how components interact Implementation must conform to architecture.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Introduction to Object-Oriented Programming CS 21a: Introduction to Computing I First Semester,
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Architectural Reasoning in ArchJava Jonathan Aldrich Craig Chambers David Notkin University of Washington ECOOP ‘02, 13 June 2002.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Unified Modeling (Part I) Overview of UML & Modeling
ArchJava Connecting Software Architecture to Implementation Jonathan Aldrich Craig Chambers David Notkin University of Washington ICSE ‘02, May 22, 2002.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
StringTemplate Terence Parr University of San Francisco
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Programming Languages and Paradigms Object-Oriented Programming.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Chapter 4 Objects and Classes.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
OOPs Object oriented programming. Based on ADT principles  Representation of type and operations in a single unit  Available for other units to create.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Introduction to Object-Oriented Programming
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
Object Oriented Programming: Java Edition By: Samuel Robinson.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
JCMP: Linking Architecture with Component Building Guoqing Xu, Zongyuan Yang and Haitao Huang Software Engineering Lab, East China Normal University SACT-01,
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 8: Semantic Analysis and Symbol Tables.
Systems Analysis and Design in a Changing World, 3rd Edition
Starting Object Design
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
CSC3315 (Spring 2008)1 CSC 3315 Subprograms Hamid Harroud School of Science and Engineering, Akhawayn University
© 2005 Prentice Hall9-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
© Keren Kalif Advanced Java Topics Written by Keren Kalif, Edited by Liron Blecher.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Session 7 Methods Strings Constructors this Inheritance.
CS536 Semantic Analysis Introduction with Emphasis on Name Analysis 1.
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
DESIGN PATTERNS COMMONLY USED PATTERNS What is a design pattern ? Defining certain rules to tackle a particular kind of problem in software development.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
What is a Servlet? Java Program that runs in a Java web server and conforms to the servlet api. A program that uses class library that decodes and encodes.
1 COS 260 DAY 14 Tony Gauvin. 2 Agenda Questions? 6 th Mini quiz graded  Oct 29 –Chapter 6 Assignment 4 will be posted later Today –First two problems.
The Facade Pattern (Structural) ©SoftMoore ConsultingSlide 1.
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Chapter 3: Introducing the UML
Access Specifier. Anything declared public can be accessed from anywhere. Anything declared private cannot be seen outside of its class. When a member.
Evolve What is a Component? A component is a unit of software that can be instantiated, and uses interfaces to describe which services it provides and.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
3 Project Objectives Aspectual Collaborations (AC) for the Connection Aspect –Metric: Does the restructuring of the UAV code with AC reduce the tangling.
Syntax-Directed Definitions CS375 Compilers. UT-CS. 1.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Module Road Map Refactoring Why Refactoring? Examples
Semantic Analysis with Emphasis on Name Analysis
ATS Application Programming: Java Programming
Programming Models for Distributed Application
Interface.
CSE401 Introduction to Compiler Construction
Advanced Java Programming
UNIT-III Structural Design Patterns
CISC124 Assignment 3 sample solution will be posted tonight after 7pm.
Constructors, GUI’s(Using Swing) and ActionListner
Introduction to Object-Oriented Programming
Object Oriented Design
Course Overview PART I: overview material PART II: inside a compiler
Plug-In Architecture Pattern
Presentation transcript:

ArchJava A software architecture tool –components –connections –constraints on how components interact Implementation must conform to architecture

References ECOOP 2002 paper ICSE 2002 paper website on ArchJava ArchJava reference manual

Architectural Conformance communication integrity –each component in the implemented system may only communicate directly with the components to which it is connected in the architecture.

public component class Parser { public port in { provides void setInfo(Token symbol, SymTabEntry e); requires Token nextToken() throws ScanException; } public port out { provides SymTabEntry getInfo(Token t); requires void compile (AST ast);} void parse (String file) { Token tok = in.nextToken(); AST ast = parseFile(tok); out.compile(ast); } AST parseFile(Token lookahead) { … } void setInfo(Token t, SymTabEntry e) {… } SymTabEntry getInfo(Token t) { … } … } strange that parse does not belong to a port; parse is provided.

collaboration Parser { public participant in { provides void setInfo(Token symbol, SymTabEntry e); requires Token nextToken() throws ScanException; } public participant out { provides SymTabEntry getInfo(Token t); requires void compile (AST ast); void parse (String file) { Token tok = in.nextToken(); AST ast = parseFile(tok); out.compile(ast); } AST parseFile(Token lookahead) { … } void setInfo(Token t, SymTabEntry e) {… } SymTabEntry getInfo(Token t) { … } … } can we do the same with an aspectual collaboration?

public component class Compiler { private final Scanner scanner = … ; private final Parser parser = … ; private final CodeGen codegen = … ; connect scanner.out, parser.in; connect parser.out, codegen.in public static void main(String args[]) { new Compiler().compile(args); } public void compile(String args[]) { // for each file in args do: … parser.parse(file); … }

Composite components sub component: component instance nested within another component. singleton sub components: final connections: connect primitive is symmetric –bind each required method to a provided method with same name and signature –args to connect: components own ports or those of subcomponents in final fields

Composite components Provided methods can be implemented by forwarding invocations to sub components or to the required methods of another port. Alternative connection semantics: write smart connectors. Only a component’s parent can invoke its methods directly.

Dynamic architectures create component instances with new. typed references to sub components may not escape the scope of their parent. Garbage collection when components are no longer reachable through references or connections.

public component class WebServer { private final Router r = new Router(); connect r.request, create; // may be instantiated at run-time // personality analogy connect pattern Router.workers, Worker.serve; public void run() { r.listen(); } private port create { provides r.workers requestWorkers() { final Worker newWorker = new Worker(); r.workers connection = connect(r.workers, newWorker.serve); return connection; }

public component class Router {

Limitations of ArchJava only Java inter-component connections must be implemented through method calls (not events, for example) focus on communication integrity no reasoning about temporal ordering of architectural events shared data

Example: Aphyds Developed by EE professor with PhD in CS

Hypotheses Do those hypotheses hold for aspectual collaborations? A port corresponds to a participant. In ArchJava: no renaming of methods in connectors

Hypotheses Refactoring an application to expose its architecture is done most efficiently in small increments Applications can be translated into ArchJava with a modest amount of effort and without excessive code bloat

Hypotheses Expressing software in ArchJava highlights refactoring opportunities by making communication protocols explicit. Note: the name of a port gives a clue about the purpose of the port’s methods.

Hypotheses Using separate ports and connections to distinguish different protocols and describing protocols with separate provided and required port interfaces may ease program understanding tasks. Communication integrity in ArchJava encourages local communication and helps to reduce coupling between components.

Architectural Refactoring during Translation ArchJava’s

Ideas Can ArchJava constraints be simulated in AspectJ? Simulate a component class with aspects that check the constraints? What are the connections between ports and participants? Law of Demeter and default architecture.

Ports and Participants Sounds like ports are a second very useful application of the participant idea. Participants are connected in a graph; ports don’t rely on that.

Ports and Participants ArchJava has provides/requires connect: link ports no renaming no component merging AC has provides/requires attach: link participants renaming of method names component merging

component class Flying { port flier { provides void fly(); requires void takeOff(); requires void land(); …}} component class Bat { port flier_infra { provides void takeOff(); provides void land(); … } } component class FlyingBat { private final Flying f = … ; private final Bat b = … ; connect f.flier, b.flier_infra; public void fly() { f.fly();} }

Topic Switch

Hygienic Components and Mixins class AddAttribute extends C{ // mixin class that adds a field of type // Attribute to any class C private Attribute _a; void setAttribute(Attribute a) {_a = a;} Attribute getAttribute() {return _a;} } class Point { … }