Catalysis/Testing Catalysis Objects, components, and Frameworks with UML.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Basic Concepts in Component-Based Software Engineering
Chapter 14 (Web): Object-Oriented Data Modeling
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented design 2.
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Logical Architecture and UML Package Diagrams
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
Logical Architecture and UML Package Diagrams 徐迎晓 复旦大学软件学院.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
An Introduction to Software Architecture
©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Component-based development l Building software from reusable components l Objectives.
Introduction to MDA (Model Driven Architecture) CYT.
1 Catalysis Methodology Ali Khoshgozaran August 2002
BTS430 Systems Analysis and Design using UML Domain Model Part 1—Finding Conceptual Classes.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Requirements To Design--Iteratively Chapter 12 Applying UML and Patterns Craig Larman.
Expression evaluation E : S | C. S = int. C = Op E E. Op : A | M. A = “+”. M = “*”.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Slides for Gregor Kiczales Two versions –short version: Crosscutting capabilities for Java and AspectJ through DJ (4 viewgraphs only) –long version: Controlling.
L10 - April 12, 2006copyright Thomas Pole , all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CS551 - Lecture 8 1 CS551 Modelling with Objects (Chap. 3 of UML) Yugi Lee STB #555 (816)
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
Not only mark-up languages! There are other many other grammar formalisms and tools than XML. Some of them standardized (ASN). Even XML does not always.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
1 COMP 350: Object Oriented Analysis and Design Lecture 1Introduction References: Craig Larman Chapter 1.
Catalysis/Testing Catalysis Objects, components, and Frameworks with UML.
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Design Model Lecture p6 T120B pavasario sem.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
Object-Oriented Programming Chapter Chapter
UML Package Diagrams. Package Diagrams UML Package Diagrams are often used to show the contents of components, which are often packages in the Java sense.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Session 3 How to Approach the UML Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 5, 2011 Presented by Kang-Pyo Lee.
Problem with Java and how it causes a problem for DJ.
AOP/cross-cutting What is an aspect?. An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease.
CSIS 4850: CS Senior Project – Spring 2009 CSIS 4850: Senior Project Spring 2009 Object-Oriented Design.
AOP/cross-cutting What is an aspect?. An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease.
R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
Logical Architecture and UML Package Diagrams. The logical architecture is the large-scale organization of the software classes into packages, subsystems,
Analysis Classes Unit 5.
UML Diagrams By Daniel Damaris Novarianto S..
Crosscutting Capabilities for Java and AspectJ through DJ
OO Methodology OO Architecture.
ADAPTIVE PROGRAMMING Sezen ERDEM December 2005.
Chapter 5 Designing the Architecture Shari L. Pfleeger Joanne M. Atlee
Slides by Steve Armstrong LeTourneau University Longview, TX
Chapter 20 Object-Oriented Analysis and Design
Starting Design: Logical Architecture and UML Package Diagrams
Analysis models and design models
Lecture 21: Crosscutting Aspect-Oriented Programming Background
An Introduction to Software Architecture
Objects, components, and Frameworks with UML
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

Catalysis/Testing Catalysis Objects, components, and Frameworks with UML

Catalysis/Testing From the book Objects, components, and frameworks with UML: the Catalysis Approach, by Desmond D’Souza and Alan Wills.

Catalysis/Testing A tour Objects and actions –object: cluster of information + functionality –action: anything that happens actions can be independent of objects. Bound to objects later. –what happens during action –which object is responsible for doing action –which object is responsible for initiating action –how is it done actions affect objects

Catalysis/Testing Fractal picture A fractal picture has the same appearance at all scales objects: business departments, machines, running software components, programming language concepts actions: interactions among objects: big business deals,phone calls, bike rides, etc.

Catalysis/Testing Actions affect objects Actions = collaborations In Catalysis collaborations are first-class units of design. Where should collaborations be used? –what goes on inside a software component –user-component interactions –business modeling: how do real-world objects interact?

Catalysis/Testing Actions affect objects Actions have participants (objects) Which objects do you need? Enough to describe the actions Associations provide a vocabulary in which it is possible to describe effects of actions (prefer: class graph over associations)

Catalysis/Testing Precise specifications action(student,teacher):: teach(skill) post student.accomplishments = skill

Catalysis/Testing Refinement Of objects and actions Zoom in and out

Catalysis/Testing Connection to aspectual components objects, components (actions), connectors actions have a modification interface

Catalysis/Testing Commonalities Catalysis/AC actions independent of objects abstract does not mean fuzzy program should be structured according to a business model static model AC independent of objects AC is abstract and executable program should look like a design participant graph

Catalysis/Testing Differences Catalysis/AC actions cannot describe aspects uses pre- and post- conditions no connectors AC (when modification interface is used) can model aspects should use pre and post conditions connectors keep components clean

Catalysis/Testing Development Layers: vanilla development from scratch Business model (domain/essential model) Requirements specification Component design Object design Component kit architecture: needed to build interoperable components April 11,99

Catalysis/Testing Static models and invariants An action’s postcondition can be written in terms of static relationships Connection: participant graph of AC contains information to describe postconditions

Catalysis/Testing Model Frameworks as Templates Similar to AC, but no aspects parameterized

Catalysis/Testing Requirements Specification Models Objects in this diagram are not real objects but rather the system’s own representation of them Static model: is a hypothetical picture created for explaining the systems externally visible behavior to its users.

Catalysis/Testing Static model (continued) There is no mandate on the designer to implement it exactly with classes and variables that mirror directly the types and associations in the spec.

Catalysis/Testing Partitioning the model between components Each of the components performs only some of the system’s functions and includes only part of its state different vocabulary; need map reconstruct all the attributes and associations from component design

Catalysis/Testing Collaborations Now: a collaboration is a collection of actions and the types of objects that participate in them Sometimes they say: action = collaboration

Catalysis/Testing Testing When does a more detailed design conform/implement/refine a more abstract one? How to test different kinds of refinement relations? Connection: refinement/testing

Catalysis/Testing Testing Pre and post conditions useful for testing test harness C++ STL library: has assert macro Every component needs to have its own test kit to monitor behavior in new context

Catalysis/Testing Retrieval functions Every implementation should have a complete set of retrieval functions; that is, read only abstraction functions for computing the value of every attribute in the spec. from the implementation Need to translate from one model to another Retrieval functions can be inefficient: only used for verification; e.g. testing.

Catalysis/Testing Retrieval functions Long history: VDM, Z support traceability: how change in spec or code influences the other use retrieval diagrams

Catalysis/Testing Benefits of retrieval functions cross-check make it explicit how abstract model is represented in the code testing: execute postconditions and invariants defined in requirement model

Catalysis/Testing Golden rule of OOD Choose your classes to mirror your specification model. 1-1 correspondence often not possible –model that gives best performance often different from one that clearly explains what the object does –multiple models are implemented simultaneously: each model: partial view

Catalysis/Testing Testing by adapting the implementation Specification (with test information) Implementation package –Adapter –Implementation

Catalysis/Testing Spreadsheet Cell Content value right Number Blank left Sum content shows Invariants: for all Sum objects s: s.value = s.left.content.value + s.right.content.value for all Blank objects b: b.value = 0 * Simplified: a formula can be only the sum of two other cells

Catalysis/Testing Spreadsheet Cell Content value right Number Blank left Sum content shows Invariants: for all Sum objects s: s.value = s.left.content.value + s.right.content.value for all Blank objects b: b.value = 0 * Spreadsheet_1 Cell_I isBlank:boolean value Sum_Icontainer sumpart shows RETRIEVAL DIAGR. operands impl1 abs Sum s; s.left = s.impl1.operands[1].abs s.right=s.impl1.operands[2].abs s.value=s.impl1.container.value * *

Catalysis/Testing Retrieval functions with DJ How to represent the participant graph? –Use strategy graph. Introduce a string for each edge. E1 = “{A->B bypassing X}”. class A {B getB(){return (B) tg.fetch(this);} } –tg is the traversal graph for E1.

Catalysis/Testing Retrieval functions Overlay concrete class graph with participant class graph using getter functions that are implemented using strategies. Name map is identity map. Can simplify class graph before writing strategies. Can introduce multiple class graph views.

A = s A BB C C D D E E F=t F G S S is participant graph for G

Catalysis/Testing Catalysis Process: Main Theme Higher-level Lower-level, a refinement of higher level. Retrieve mapping from higher-level to lower-level. For every specification activity there is a corresponding implementation and testing activity

Catalysis/Testing Typical Process for a Business System Requirements System Specification Architectural Design: components/connectors –application architecture: packages, collaborations –technical architecture: hardware, software platform, infrastructure components Component Internal Design

Catalysis/Testing Typical Project Evolution : page 522 The business case: initial requirements Domain or business model: independent of software solution. Reusable across multiple projects. Joint-Application Development: developers/users Glossary

Catalysis/Testing Typical Project Evolution Type model plus system specifications. Primary actions system participates in. Refined to atomic interaction with system. UI sketches Subject areas Generic problem frameworks Refactor for reuse

Catalysis/Testing Typical Project Evolution Design rules for technical architecture Technical architecture model Horizontal slices: architecture simulation Application architecture: design of application logic as a collection of collaborating components Project plan, deployment

Catalysis/Testing Testing/Specification Write action specifications precisely enough –to form the basis for testing and –to make the model explicit enough to uncover business issues

Catalysis/Testing Chapter 3: Behavior Models Component-based software development: separate external behavior from internal implementation Describe behavior: by list of actions and response to those actions (called the component’s type)

Catalysis/Testing Actions action (party1:Type1, party2:Type2,…) ::actionName(…) not centered on a single object type action effect is described in terms of of all participant

Catalysis/Testing More precise action specifications Well-written pre- and postconditions can be used as the basis for verification and testing Use general syntax from UML called Object Constraint Language (OCL). More convenient than Java Pre- and postconditions

Catalysis/Testing Two parts of a specification Static model (structure): UML class diagram and invariants Type specification (behavior): specify effects of actions on component using vocabulary provided by static model This chapter: about how to derive and write type specifications. Examples follow.

Catalysis/Testing Static model with behavior Course Scheduling ClientSession fullSchedule sessions* client * Instructor rating: Grade staff * instructor 0..1 sessions*grade: Grade date : Date Invariant (business rule): fullSchedule.grade <=fullSchedule.instructor.rating checkAvailability(instructor,date) post: find whether instructor is doing a session on that date scheduleCourse(date,client) post: set up a new session and assign an instructor {ordered date} Static model behavior Behavior defined in terms of static model

Catalysis/Testing Static Model BusRoute BusStop Person busStops waiting 0..* find all persons waiting at any bus stop on a bus route 0..* DOES NOT REVEAL TOO MANY IMPLEMENTATION DETAILS

Catalysis/Testing Implementation 1 BusRoute BusStopList BusStop BusList BusPersonList Person passengers buses busStops waiting 0..* find all persons waiting at any bus stop on a bus route OO solution: one method for each red class

Catalysis/Testing Implementation 2 BusRoute BusStopList BusStop BusList BusPersonList Person passengers buses busStops waiting 0..* VillageList Village villages 0..* find all persons waiting at any bus stop on a bus route

Catalysis/Testing Filter out noise in class diagram only three out of seven classes are mentioned in static model BusRoute BusStop Person BusRoute VillageList Village BusStopList BusStop PersonList Person replaces the classes

Catalysis/Testing Map static model to application class graph BusRoute BusStopList BusStop busStops0..* VillageList Village villages 0..* edge -> path BusRoute BusStop busStops 0..*

Catalysis/Testing Using DJ class BusRoute { Vector busStops(){return Main.cg.gather(this, new Strategy( “from BusRoute to BusStop”);} }

Catalysis/Testing Using DJ: complete solution class BusRoute { Vector waitingPersons(){return Main.cg.gather(this, new Strategy( “from BusRoute via BusStop to Person”);} }

Catalysis/Testing Notes Static model is translated into a strategy Why? With DJ behavior is written in such a way that it is usable in many different static models

Catalysis/Testing Two approaches Catalysis: Define static model and define behavior using static model Map static model to implementation model Behavior is in implementation model DJ: Define strategies corresponding to static model and express behavior using strategies. Adjust strategies for implementation model. Behavior is in implementation model

Catalysis/Testing Using DJ: complete solution Java problem: parameterization class BusRoute { Vector waitingPersons(){return Main.cg.gather(this,new Strategy( “from BusRoute via BusStop to Person”);} }

Catalysis/Testing Using DJ: complete solution Java problem: parameterization class BusRoute { PersonList waitingPersons(){return Main.cg.traverse(this,new Strategy( “from BusRoute via BusStop to Person”,new PersonVisitor());} }

Catalysis/Testing Resource Allocation reqs when: TimeInterval 0..* type allocated provides0..* 0..1 inv Job::allocated<>0 ==> allocated.provides->includesAll(type.reqs) --Any allocated resource must have the required facilities inv Resource::jo1, jo2: Job:: (schedule->includesAll({jo1,jo2}) ==> jo1.when.noOverlap(jo2.when) -- no double-booking of resources schedule 0..*

Catalysis/Testing Resource Allocation JobDescription Skill reqs Job when: TimeInterval Plumber 0..* type allocated provides0..* 0..1 schedule 0..* Resource Allocation Facility Resource Job JobCategory Application of resource allocation to Pluming Customer

Catalysis/Testing Reuse and Pluggable design chapter 11 Reuse requires components that are –generic –customizable Reuse: most compelling reason for adopting component-based approaches

Catalysis/Testing Reuse Reuse without alteration? Is limited.

Catalysis/Testing What is an aspect? An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease an aspect apart into three units: ideal graph, labels on nodes and edges of ideal graph, application to concrete graph using connectors: specifies cross-cutting

Catalysis/Testing Example: ACs Ideal graph: participant graph Labels on nodes and edges: participant code Concrete graph: participant graph or application class graph Connectors specify cross-cutting

Catalysis/Testing Theory of cross cutting Model programs as graphs (e.g. class diagrams, abstract syntax trees, etc.) Aspects: model as graph editing instructions modeled with respect to an ideal graph. Graph editing: add new