CPSC 871 John D. McGregor Module 4 Session 1 Architecture Analysis/Design.

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Software Architecture Design Instructor: Dr. Jerry Gao.
1: Operating Systems Overview
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 11 Slide 1 Architectural Design.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
OPERATING SYSTEM OVERVIEW
Establishing the overall structure of a software system
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
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 11 Slide 1 Architectural Design.
What is Software Architecture?
Advances in Language Design
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Systems Analysis and Design in a Changing World, Fifth Edition
CPSC 372 John D. McGregor Module 3 Session 2 Architecture Analysis/Design.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 13Slide 1 Architectural Design u Establishing the overall structure of a software system.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
An Introduction to Software Architecture
Architectural Design portions ©Ian Sommerville 1995 Establishing the overall structure of a software system.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Software Engineering General architecture. Architectural components:  Program organisation overview Major building blocks in a system Definition of each.
Architectural Design To explain the advantages and disadvantages of different distributed systems architectures To discuss client-server and distributed.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Architectural Design lecture 10. Topics covered Architectural design decisions System organisation Control styles Reference architectures.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Cohesion and Coupling CS 4311
Systems Analysis and Design in a Changing World, 3rd Edition
CPSC 372 John D. McGregor Module 3 Session 1 Architecture.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
John D. McGregor Class 4 – Initial decomposition
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
1: Operating Systems Overview 1 Jerry Breecher Fall, 2004 CLARK UNIVERSITY CS215 OPERATING SYSTEMS OVERVIEW.
CSC480 Software Engineering Lecture 10 September 25, 2002.
©Ian Sommerville, Robin Abraham 2004CS 361, Summer 2004 Slide 1 Architectural Design.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Object-Oriented Design Concepts University of Sunderland.
Slide 1 Chapter 8 Architectural Design. Slide 2 Topics covered l System structuring l Control models l Modular decomposition l Domain-specific architectures.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 5:Architectural Design l Establishing the overall structure of a software.
Introduction to Operating Systems Concepts
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
John D. McGregor Module 3 Session 2 Architecture Analysis/Design
Software Design Refinement Using Design Patterns
CS 325: Software Engineering
Coupling and Cohesion 1.
Part 3 Design What does design mean in different fields?
Hierarchical Architecture
The Object Oriented Approach to Design
John D. McGregor Quality attributes
Component-Level Design
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Software Architecture
Architectural Design.
Operating Systems : Overview
An Introduction to Software Architecture
Operating Systems : Overview
John D. McGregor Module 6 Session 1 More Design
Operating Systems : Overview
Chapter 4: Threads.
Operating Systems : Overview
Presentation transcript:

CPSC 871 John D. McGregor Module 4 Session 1 Architecture Analysis/Design

Design Architecting is design It is very high-level design, but the rules of design apply But the decisions that are made vary depending upon the system context The structures include bundles of functionality (classes, packages) but also control flow and data flow There are also static vs dynamic perspectives

Static

Dynamic

Dynamic, more detail

Different perspectives and levels

Design Principles Abstraction Coupling and cohesion Decomposition and modularization Encapsulation/information hiding Separation of specification from implementation Sufficiency, completeness and primitiveness

Abstraction Removal of detail to focus on essentials Sometimes handled by folding Representing a real world object such as a house as a graphic is abstraction Representing any real world object in software is an abstraction Downsides: loss of accuracy; reduced testability

Layers Layering abstracts away details. The “hardware abstraction layer” is the layer between the hardware and your application. Enhances portability. Separates concerns

Interfaces in layering An component “provides” services/capabilities through an interface A component “requires” services/capabilities from other components

APIs Application Programmer Interface (API) What is an “outsider” allowed to make the component do? Extensibility at programming time Extensibility at runtime

Coupling and Cohesion Two objects are tightly coupled when almost every time one object is changed, the other must be changed as well. Coupling refers to a relationship BETWEEN two entities. If there are few relationships between two modules then coupling is low. If coupling is high the architect may decide to encapsulate the two entities into one.

Coupling modifyCustomer Return Customer SalesRep writes a string to the name field of the customer record OR SalesRep uses methods on the Customer object to change the name Affects maintainability and extensibility

Coupling and Cohesion An object is cohesive if the properties and the functions can’t be divided into subsets that have no overlap. Cohesion refers to a relationship WITHIN an entity. If the features within a module are strongly related then cohesion is high. If cohesion is low the architect may want to divide the module into two or more modules.

Cohesion Methods access list data structure and members of the list Methods access list data structure OR members of the list

Decomposition and modularization By decomposing we have 2 modules instead of one. Each is more Isolated from the other. One can be changed without affecting the other.

Encapsulation/information hiding I distinguish between these two where other people often do not. Encapsulation is packaging that allows movement or copying from one place to another. A class encapsulates the operations and properties defined within so that it is easy to use this definition in another program. Java makes it even easier by encapsulating a class in a file. Marking a definition in a class as private prevents elements outside the class from manipulating it directly. Public, encapsulated definitions can be accessed from anywhere.

Separation of specification from implementation Information hiding is used to enforce the separation of the specification from the implementation. Users are forced to use the interface methods in the specification. System message sendMessage(); End message; System implementation message.plainText End message; System implementation message.encrypted End message;

Sufficiency, completeness and primitiveness Start with smallest pieces Build up through aggregation/composition Encapsulate each new concept and protect using information hiding Stop when it is complete Don’t elaborate just to be elaborating; add when it adds value

2 levels Static, definition time architecture Dynamic, runtime architecture Must visualize the runtime for many of the design issues

Design Issues Concurrency Control and Handling of Events Distribution of Components Error and Exception Handling and Fault Tolerance Data Persistence Interaction and Presentation

Concurrency Two issues – time and order Timing – Two things can not physically happen at the same time in a concurrent program but they can logically – Two things can physically happen at the same time in a parallel program Process/thread – Processes are heavy weight; clear all data registers when switching from one to another – Threads are light weight; only clears instruction pointer Concurrency is used when it makes the control flow simpler

Concurrency - 2 Break the solution into blocks that can be worked on independently As long as there are no shared (process level) variables, threading is easy When two threads will access the same data in write-mode there must be some level of synchronization – May be logical – the developer is “certain” – May be code-based – structures “lock” the location Many schemes for locking

Control and Handling of Events An event is an object created in response to some outside stimulus This allows the action to be passed around the system. A registry allows “handlers” to register their interest in certain events. When an event is created the registry sends the event out to all handlers (broadcast) or to only those registered for the type of event (point-to-point)

Architecture Pattern Event generator Event Event Handler Registry register generate notify Event handling is so routine that we have standard patterns and some languages, like Java, have implementations that are reusable.

Distribution of Components A type of computing in which different components and objects comprising an application can be located on different computers connected to a network.components objectsapplicationnetwork What is “different computer”? – Processes – Cores – Physical boxes Multi-core, many-core, dual core all have more than one CPU co-located in the same box A single application can have multiple operations at the same time.

Distribution of Components - 2

Behavior Annex State machines Variables status: aadlinteger; States off: initial state warmup: state ready:state charging:state Transitions off-[WarmUp]->warmup;

Behavior Annex - 2 The initiator of a transition is a subprogram off-[WarmUp]->warmup; WarmUp is: Subprogram WarmUp Features … Flows … end WarmUp;

Error and Exception Handling and Fault Tolerance When a location having a fault is executed that result is propagated along the data flow of the program That faulty execution may cause other executions to be in error even though there is no fault at that location. If the result propagates that will lead to a failure to satisfy the specification. Detecting the error as soon as possible requires program logic to perform checks of type and magnitude Then when it is detected where do we want flow of data/control to go?

Error and Exception Handling and Fault Tolerance - 2 Exception handling provides a means to interrupt normal flow and give it to an exception handler. The handler may correct the data locally and resume normal flow or The handler may decide it can not correct and hand control to the next handler in a hierarchy of handlers

Error and Exception Handling and Fault Tolerance - 3 Try/catch in Java and C++ are implementations of this pattern The details of what the exception handler does is component design But the overall flow is architectural because it cuts across modules

From: ndling-3-tier.aspx

Fault tolerance Some errors can’t be avoided but we can tolerate them. Meaning we can continue operation in some form even after executing a fault. After an exception is caught… Cancel an operation Reset to default values … Even rerunning the same algorithm again might work due to “context”

Data Persistence Local variables, return values, parameters, class variables, global variables Configuration files, data files, caches, database tables Persistent – data is available after its scope is exited Becomes architectural when it persists across module boundaries

Data Persistence - 2 Data flow is a fundamental “structure” of a system Every piece of data has a lifetime and it should happen by design not by accident Choice of storage is due to type of data and performance requirements

Interaction and Presentation Response to a user should be fast Data from a user should be validated as close to the user as possible Interaction should eliminate as many mistakes as possible – a spinner widget with the names of states so spelling errors are eliminated Usability – choice of colors, localization