Architecture, Design Patterns and Faithful Implementation

Slides:



Advertisements
Similar presentations
Database System Concepts and Architecture
Advertisements

COM vs. CORBA.
A component- and message-based architectural style for GUI software
Software Reuse SEII-Lecture 28
Architectural Mismatch: Why Reuse Is So Hard David Garlan, Robert Allen, and John Ockerbloom Presented by Hoang Bao CSC 509 – Winter 2005.
ARCHITECTURAL RECOVERY TO AID DETECTION OF ARCHITECTURAL DEGRADATION Joshua Garcia*, Daniel Popescu*, Chris Mattmann* †, Nenad Medvidovic*, and Yuanfang.
University of Southern California Center for Systems and Software Engineering Design-Code Review Preparation Pongtip Aroonvatanaporn CSCI577b Spring 2012.
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
Architecture-driven Modeling and Analysis By David Garlan and Bradley Schmerl Presented by Charita Feldman.
ICS 123 Interoperability ICS 123 Richard N. Taylor and Eric M. Dashofy UC Irvine
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. Implementing Architectures Software Architecture Lecture 15.
Software Architecture Design Instructor: Dr. Jerry Gao.
The Architecture Design Process
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse 2.
INTRODUCTION TO WEB DATABASE PROGRAMMING
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 18 Slide 1 Software Reuse.
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
MVC pattern and implementation in java
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.
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. Implementing Architectures Software Architecture.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 07. Review Architectural Representation – Using UML – Using ADL.
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. Architectures in Context Software Architecture Lecture 2.
Basic Concepts Software Architecture. What is Software Architecture? Definition: – A software architecture is the set of principal design decisions about.
Model-Driven Analysis Frameworks for Embedded Systems George Edwards USC Center for Systems and Software Engineering
R R R 1 Frameworks III Practical Issues. R R R 2 How to use Application Frameworks Application developed with Framework has 3 parts: –framework –concrete.
Software Architecture and Design Dr. Aldo Dagnino ABB, Inc. US Corporate Research Center October 23 rd, 2003.
Architectural Design lecture 10. Topics covered Architectural design decisions System organisation Control styles Reference architectures.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. Implementing Architectures Software Architecture Lecture 11.
CPSC 372 John D. McGregor Module 3 Session 1 Architecture.
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
Frameworks CompSci 230 S Software Construction.
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. NFP Design Techniques Software Architecture Lecture 20.
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. NFP Design Techniques Software Architecture Lecture 20.
CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 18 Slide 1 Software Reuse.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 system architecture 1 after designing to meet functional requirements, design the system.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Chapter 6 – Architectural Design Lecture 1 1Chapter 6 Architectural design.
CSC480 Software Engineering Lecture 10 September 25, 2002.
Design and Implementation of a Rationale-Based Analysis Tool (RAT) Diploma thesis from Timo Wolf Design and Realization of a Tool for Linking Source Code.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Implementation Chapter 6. Introduction Implementation one of the most important phase of software development, it can not be optional For better quality.
Software Engineering Chapter: Computer Aided Software Engineering 1 Chapter : Computer Aided Software Engineering.
University of Southern California Center for Systems and Software Engineering Architecture and Design Patterns CSCI577A Fall2015 Kan Qi, Bo Wang.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
Basic Concepts and Definitions
Architecture, Design Patterns and Faithful Implementation David Woollard University of Southern California Software Architecture Group NASA Jet Propulsion.
Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann,
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
Architectural Mismatch: Why reuse is so hard? Garlan, Allen, Ockerbloom; 1994.
Implementation, Deployment and Mobility. ConceptsConcepts Concepts – Implementation as a mapping problem – Architecture implementation frameworks – Evaluating.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Implementing Architectures
Implementing Architectures
Model-Driven Analysis Frameworks for Embedded Systems
Lecture 2 – The Context of Software Architecture
Software Architecture Lecture 20
Implementing Architectures
An Introduction to Software Architecture
Implementing Architectures
Implementing Architectures
Automated Analysis and Code Generation for Domain-Specific Models
Applying Use Cases (Chapters 25,26)
Architectural Mismatch: Why reuse is so hard?
From Use Cases to Implementation
Presentation transcript:

Architecture, Design Patterns and Faithful Implementation Architecture and Design Patterns (and Frameworks) Architecture, Design Patterns and Faithful Implementation David Woollard University of Southern California Software Architecture Group NASA Jet Propulsion Laboratory Data Management Group

Lessons Moving Forward (Recap) Patterns are helpful at the developer level Styles are good sources of inspiration, but one size does not fit all Complex software systems often exhibit multiple styles Breaking style rules can be OK, but know why you are doing it and make sure its for a good reason. Requirements drive design and vice versa How to move forward? Faithful Implementation... But that’s for the next lecture. this lecture.

Goals of This Lecture In this lecture, we will cover: Faithful Implementation Mapping the Architecture The Role of Middleware/Frameworks In Depth: How To Build A GUI A Technologist’s Perspective: Building a Better Web Application Lessons Moving Forward

Faithful Implementation All of the structural elements found in the architecture are implemented in the source code Source code must not utilize major new computational elements that have no corresponding elements in the architecture Source code must not contain new connections between architectural elements that are not found in the architecture What if we deviate from this?

Unfaithful Implementation The implementation does have an architecture It is latent, as opposed to what is documented Failure to recognize the distinction between planned and implemented architecture Robs one of the ability to reason about the application’s architecture in the future Misleads stakeholders regarding what they believe they have as opposed to what they really have Makes any development or evolution strategy that is based on the documented (but inaccurate) architecture doomed to failure

Implementation Strategies Generative techniques e.g. parser generators Frameworks collections of source code with identified places where the engineer must “fill in the blanks” Middleware CORBA, DCOM, RPC, … Reuse-based techniques COTS, open-source, in-house Writing all code manually

The Mapping Problem Architecture-based development provides a unique twist on the classic problem It becomes, in large measure, a mapping activity Maintaining mapping means ensuring that our architectural intent is reflected in our constructed systems Design Decisions Implementation Artifacts

What Are We Mapping? Components and Connectors Interfaces Partitions of application computation and communication functionality Modules, packages, libraries, classes, explicit components/connectors in middleware Interfaces Programming-language level interfaces (e.g., APIs/function or method signatures) are common State machines or protocols are harder to map

What Are We Mapping? Configurations Design rationale Interconnections, references, or dependencies between functional partitions May be implicit in the implementation May be externally specified and enabled through middleware May involve use of reflection Design rationale Often does not appear directly in implementation Retained in comments and other documentation

What Are We Mapping? Dynamic Properties (e.g., behavior): Usually translate to algorithms of some sort Mapping strategy depends on how the behaviors are specified and what translations are available Some behavioral specifications are more useful for generating analyses or testing plans Non-Functional Properties Extremely difficult to do since non-functional properties are abstract and implementations are concrete Achieved through a combination of human-centric strategies like inspections, reviews, focus groups, user studies, beta testing, and so on

Risking Drift: One-Way Mapping Your understanding of the architecture will change as you develop an implementation You will know more Your stakeholders will know more Time/Budget/Personnel/Etc. changes Keeping the implementation faithful is a challenge If the implementation and architecture are not in sync, you’ve drifted

A Better Way: Two-Way Mapping Both a technical and a managerial problem Must understand how a change in the implementation impacts architecture-level design decisions Two strategies: Limit changes Change either, but require round-trip mappings and maintenance strategies Tools can help Peer reviews are better

Implementation Strategies Revisited Generative techniques Frameworks Middleware Reuse-based techniques Writing all code manually - Normally impractical Probably not looking hard enough

Reused-based Techniques Out of the scope of this lecture Probably only a partial solution Beware architectural assumptions: David Garlan, Robert Allen and John Ockerbloom. Architectural Mismatch: Why Reuse is so Hard. In IEEE Software, Vol. 12(6):17-26, 1995.

Middleware vs. Frameworks Implementation frameworks are forms of middleware There’s a subtle difference in how they emerge and develop Middleware generally evolves based on a set of services that the developers want to have available E.g., CORBA: Support for language heterogeneity, network transparency, portability Frameworks generally evolve based on a particular architectural style that developers want to use Why is this important?

Middleware vs. Frameworks By focusing on services, middleware developers often make other decisions that substantially impact architecture E.g., in supporting network transparency and language heterogeneity, CORBA uses RPC But is RPC necessary for these services or is it just an enabling technique? In a very real way, middleware induces an architectural style CORBA induces the ‘distributed objects’ style JMS induces a distributed implicit invocation style Understanding these implications is essential

More On Frameworks Frameworks are meant to assist developers in following a style But generally do not constrain developers from violating a style if they really want to Developing applications in a target style does not require a framework But if you follow good software engineering practices, you’ll probably end up developing one anyway Frameworks are generally considered as underlying infrastructure or substrates from an architectural perspective You won’t usually see the framework show up in an architectural model, e.g., as a component

In Depth: How to Build A GUI Lots of choices in frameworks Some are language-dependent Some are application-dependent Some are platform-dependent Let the architecture drive implementation At least initially

Architecture of GUIs Popular Architectures: Forms and Controls: Model-View-Controller C2 (i.e., Event-Based) Forms and Controls: Form is application-specific, but it uses controls that are generic Data-binding between session state and underlying records (DB Common architecture to applications developed in builders and web frameworks (Visual Basic, VC .Net, Xcode, etc.) Form provides application specific layout. Controls have program functionality embedded in them.

Architecture of GUIs Popular Architectures: Model-View-Controller: Forms and Controls Model-View-Controller C2 (i.e., Event-Based) Model-View-Controller: Specialization of the layered architecture Often implemented with call-backs Model: underlying object representation View: presentation of object to the user Controller: responds to events from view and changes model Architecture of Java Swing, web frameworks like Ruby on Rails, Trails Observers are registered to handle events (i.e., MouseListener) 2. MouseListener eventHandler is triggered via function call-back Controller * Model View 3. Underlying model is changed 1. User clicks on a GUI element

Architecture of GUIs Popular Architectures: C2: Forms and Controls Model-View-Controller C2 (i.e., Event-Based) C2: Event-based architecture developed by Richard Taylor, Neno Medvidovic, et. al. at UC Irvine A hierarchical network of concurrent components Communication is by event on ports Components request services “above,” reply to components “below.” Component D Repository Components only have one request port and one reply port Reply Request Component C Mediator Request Reply Component A Component B View One View Two

Platform Independent GUIs Flash/Flex (Macromedia/Adobe) Requires a browser plug-in Supports vector graphics, animations, video Scriptable (ActionScript, PHP compatible) Basically a front-end

Platform Independent GUIs AJAX* Agglomeration of readily -supported technologies (Javascript & XML) Dynamic Content (Allows callbacks and updates) Supports similar interaction as Flash without plug-in or expensive developer tools * Yes, I know I am using framework loosely

Platform Independent GUIs Plone Content Management System Developers supply object description, basic functionality comes for free Zope - Object DB (Model) No plug-in, browser-based (View) Python scripting (Controller)

Platform Independent GUIs Ruby on Rails Convention over Configuration Reflection & discovery, not XML VERY little coding MySQL DB (Model) No plug-in, browser-based (View) Ruby (Controller)

Platform Independent GUIs Non-Web Based Java Swing Application Java - OS independent Follows model-view-controller Base classes for: GUI elements event-listening Developer inherits from base classes to provide application specific functionality

Platform Dependent GUIs Cocoa GUI Builder Mac OS-X GUI builder Xcode & Interface Builder tools Form-Control pattern Element drag-and-drop Support for Objective C & Java

Platform Dependent GUIs .Net Framework Windows GUI builder Visual Studio tools Form-Control pattern Element drag-and-drop Support for C#

A Technologist’s Perspective Movie Time! http://oodt.jpl.nasa.gov/better-web-app.mov Sean Kelly, a JPL Technologist, discusses different web application development frameworks.

Lessons Moving Forward Faithful implementation is essential to the development phase Mapping can be one-way or round trip Round trip mappings are a challenge, but ultimately less risky - avoid architecture drift Middleware and Frameworks imply an architecture Choose your architecture first Not all frameworks are created equal Look for compliant architecture, ease of use, fun Avoid unnecessary sit-ups