cs485/540 software engineering architecture and component ... · cs485/540 software engineering...

Post on 22-May-2018

232 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CS485/540 Software EngineeringArchitecture and Component Design (Chs. 9,10)

Cengiz Günay

Dept. Math & CS, Emory University

Fall 2013Some slides courtesy of Joan Smith, Roger Pressman, Ian Sommerville,

and the Internets

Günay (Emory) Architecture, Component Design Fall 2013 1 / 7

Class #16

Scrum: #9Due today: Iteration plans

User stories and subtasksAssigned to who; are you ready?Timeline: Demo date and audience

Due Next Thursday: Preliminary proposals of. . .Architecture design: including directoriesLead developer: Coding standardsTest plan: acceptance, integration & unit testing frameworkData design: database, data file formats, internal data structuresDocumentation standards: user, code

Today:Chris reading.Architecture, Component-level, and User Interface Design(Chs. 9, 10, 11)

Günay (Emory) Architecture, Component Design Fall 2013 2 / 7

Class #16

Scrum: #9Due today: Iteration plans

User stories and subtasksAssigned to who; are you ready?Timeline: Demo date and audience

Due Next Thursday: Preliminary proposals of. . .Architecture design: including directoriesLead developer: Coding standardsTest plan: acceptance, integration & unit testing frameworkData design: database, data file formats, internal data structuresDocumentation standards: user, code

Today:Chris reading.Architecture, Component-level, and User Interface Design(Chs. 9, 10, 11)

Günay (Emory) Architecture, Component Design Fall 2013 2 / 7

Class #16

Scrum: #9Due today: Iteration plans

User stories and subtasksAssigned to who; are you ready?Timeline: Demo date and audience

Due Next Thursday: Preliminary proposals of. . .Architecture design: including directoriesLead developer: Coding standardsTest plan: acceptance, integration & unit testing frameworkData design: database, data file formats, internal data structuresDocumentation standards: user, code

Today:Chris reading.Architecture, Component-level, and User Interface Design(Chs. 9, 10, 11)

Günay (Emory) Architecture, Component Design Fall 2013 2 / 7

(c) dictionary.com

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 2!

Why Architecture?!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 3!

Why is Architecture Important?!!  Representations of software architecture are an enabler

for communication between all parties (stakeholders) interested in the development of a computer-based system.!

!  The architecture highlights early design decisions that will have a profound impact on all software engineering work that follows and, as important, on the ultimate success of the system as an operational entity.!

!  Architecture “constitutes a relatively small, intellectually graspable mode of how the system is structured and how its components work together” [BAS03].!

(c) vintageprintable.com

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 6!

Architectural Styles!

!  Data-centered architectures!!  Data flow architectures!!  Call and return architectures!!  Object-oriented architectures!!  Layered architectures!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 7!

Data-Centered Architecture!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 8!

Data Flow Architecture!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 9!

Call and Return Architecture!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 10!

Layered Architecture!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 11!

Architectural Patterns!!  Concurrency—applications must handle multiple tasks in a

manner that simulates parallelism !!  operating system process management pattern!!  task scheduler pattern!

!  Persistence—Data persists if it survives past the execution of the process that created it. Two patterns are common: !!  a database management system pattern that applies the storage

and retrieval capability of a DBMS to the application architecture!!  an application level persistence pattern that builds persistence

features into the application architecture!!  Distribution— the manner in which systems or components

within systems communicate with one another in a distributed environment!!  A broker acts as a ʻmiddle-manʼ between the client component and a

server component.!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 15!

Component Structure!

SafeHomeExecutive

ExternalCommunicationManagement

GUI InternetInterface

Functionselection

Security Surveillance Homemanagement

Controlpanel

processing

detectormanagement

alarmprocessing

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 16!

Refined Component Structure!

sensorsensorsensorsensorsensorsensorsensorsensor

ExternalCommunicationManagement

GUI InternetInterface

Security

Controlpanel

processing

detectormanagement

alarmprocessing

Keypadprocessing

CP displayfunctions

scheduler

sensorsensorsensorsensor

phonecommunication

alarm

SafeHomeExecutive

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 23!

Horizontal Partitioning!  define separate branches of the module

hierarchy for each major function!  use control modules to coordinate

communication between functions!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 24!

Vertical Partitioning: Factoring!  design so that decision making and work

are stratified!  decision making modules should reside at

the top of the architecture!

workers

decision-makers

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 26!

Structured Design!  objective: to derive a program

architecture that is partitioned!  approach: !

  a DFD is mapped into a program architecture!

  the PSPEC and STD are used to indicate the content of each module!

  notation: structure chart!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 28!

General Mapping Approach!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 18!

Architectural Complexity!  the overall complexity of a proposed

architecture is assessed by considering the dependencies between components within the architecture [Zha98]!  Sharing dependencies represent dependence

relationships among consumers who use the same resource or producers who produce for the same consumers.!

  Flow dependencies represent dependence relationships between producers and consumers of resources.!

  Constrained dependencies represent constraints on the relative flow of control among a set of activities.!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 19!

ADL!!  Architectural description language (ADL) provides

a semantics and syntax for describing a software architecture!

!  Provide the designer with the ability to: !!  decompose architectural components!!  compose individual components into larger architectural

blocks and !!  represent interfaces (connection mechanisms) between

components. !

Architecture Description Language (ADL) is Dead?

Stanford Rapide: Exectuable ADL (1993–96)

Used for Complex event processing (CEP) (1998–99)

UniCon from CMU (obsolete)Aesop from CMU (research 1994–96)Wright from CMU ABLE Lab (research 1994–98)

So anybody alive?Wikipedia page

“What Industry Needs from Architectural Languages: A Survey” (2013)

UML (still active!)

Günay (Emory) Architecture, Component Design Fall 2013 5 / 7

Other Architectural Issues

Open Source Development:

Choosing a license affects architecture?

Platform independenceHost-target system problems

Günay (Emory) Architecture, Component Design Fall 2013 6 / 7

(c) 2.bp.blogspot.com

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 1!

Chapter 10!!  Component-Level Design!

Slide Set to accompany Software Engineering: A Practitionerʼs Approach, 7/e #by Roger S. Pressman

Slides copyright © 1996, 2001, 2005, 2009 by Roger S. Pressman

For non-profit educational use only

May be reproduced ONLY for student use at the university level when used in conjunction with Software Engineering: A Practitioner's Approach, 7/e. Any other reproduction or use is prohibited without the express written permission of the author.

All copyright information MUST appear if these slides are posted on a website for student use.

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 3!

OO Component!

PrintJob

computeJob

initiateJob

numberOfPagesnumberOfSidespaperType paperWeight paperSize paperColormagnificationcolorRequirementsproductionFeatures collationOptions bindingOptions coverStock bleed prioritytotalJobCostWOnumber

PrintJob

computePageCost ()computePaperCost()computeProdCost()computeTotalJobCost ()buildWorkOrder()checkPriority ()passJobto Production()

elaborated design class<<interface>>computeJob

computePageCost()computePaperCost()computeProdCost()computeTotalJobCost()

<<interface>>initiateJob

buildWorkOrder()checkPriority ()passJobto Production()

design component

numberOfPagesnumberOfSidespaperTypemagnificationproductionFeatur es

PrintJob

computeJobCost()passJobtoPrinter()

analysis class

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 4!

Conventional Component!

ComputePageCost

design component

accessCostsDB

getJobData

elaborated module

PageCost

in: job sizein: color=1, 2, 3, 4in: pageSize = A, B, C, Bout: BPCout: SF

in: numberPagesin: numberDocsin: sides= 1, 2in: color=1, 2, 3, 4in: page size = A, B, C, Bout: page cost

job size (JS) = numberPages * numberDocs;lookup base page cost (BPC) --> accessCostsDB (JS, color);lookup size factor (SF) --> accessCostDB (JS, color, size)job complexity factor (JCF) = 1 + [(sides-1)*sideCost + SF]pagecost = BPC * JCF

getJobData (numberPages, numberDocs,sides, color, pageSize, pageCost)accessCostsDB(jobSize, color, pageSize,BPC, SF)computePageCost()

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 5!

Basic Design Principles!!  The Open-Closed Principle (OCP). “A module [component]

should be open for extension but closed for modification."!  The Liskov Substitution Principle (LSP). “Subclasses should be

substitutable for their base classes."!  Dependency Inversion Principle (DIP). “Depend on abstractions.

Do not depend on concretions.” !!  The Interface Segregation Principle (ISP). “Many client-specific

interfaces are better than one general purpose interface."!  The Release Reuse Equivalency Principle (REP). “The granule of

reuse is the granule of release.” !!  The Common Closure Principle (CCP). “Classes that change

together belong together.” "!  The Common Reuse Principle (CRP). “Classes that arenʼt reused

together should not be grouped together.” !

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 6!

Design Guidelines!!  Components!

!  Naming conventions should be established for components that are specified as part of the architectural model and then refined and elaborated as part of the component-level model!

!  Interfaces!!  Interfaces provide important information about

communication and collaboration (as well as helping us to achieve the OPC)!

!  Dependencies and Inheritance!!  it is a good idea to model dependencies from left to

right and inheritance from bottom (derived classes) to top (base classes).!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 7!

Cohesion!!  Conventional view: !

!  the “single-mindedness” of a module!!  OO view: !

!  cohesion implies that a component or class encapsulates only attributes and operations that are closely related to one another and to the class or component itself!

!  Levels of cohesion!!  Functional!!  Layer!!  Communicational!!  Sequential!!  Procedural!!  Temporal!!  utility!

These slides are designed to accompany Software Engineering: A Practitionerʼs Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.! 8!

Coupling!!  Conventional view: !

!  The degree to which a component is connected to other components and to the external world!

!  OO view:!!  a qualitative measure of the degree to which classes are

connected to one another!!  Level of coupling!

!  Content!!  Common!!  Control!!  Stamp!!  Data!!  Routine call!!  Type use!!  Inclusion or import!!  External!

top related