CPSC 875 John D. McGregor Metrics. Scope/variability AgileSafety-critical.
CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
-
Upload
estella-payne -
Category
Documents
-
view
219 -
download
0
Transcript of CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
![Page 1: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/1.jpg)
CPSC 871
John D. McGregorModule 3 Session 1
Architecture
![Page 2: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/2.jpg)
Session Objectives
• Give an overview of software architecture principles
![Page 3: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/3.jpg)
Software architecture
• The software architecture of a program or computing system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them.
Software Architecture in Practice (2nd edition), Bass, Clements, Kazman; Addison-Wesley 2003
![Page 4: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/4.jpg)
Warning!!
The following single pictures are NOT architectures but simplified
architecture cartoons.
![Page 5: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/5.jpg)
Connected Services
http://msdn.microsoft.com/en-us/library/aa306115.aspx
![Page 6: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/6.jpg)
Android open architecture
![Page 7: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/7.jpg)
Eclipse architecture
![Page 8: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/8.jpg)
Essential elements
• Components - a unit in which some program logic resides – should be a single concept
• Connectors – joins two components via some relationship – data or control or both flow over the connector from one component to the other
• Ports – a device on a component that allows data/control to flow into or out of the component
• Illustrated using the AADL
![Page 9: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/9.jpg)
Architecture actions
• The architect forms concepts that are contained in components and connects components that – Need data from the other component– Is the next piece of work to be done– Will refine what has already been done– And many other things
• Components often are formed to satisfy a functional requirement
![Page 10: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/10.jpg)
Quality attributes
• How the components are formed and how they are connected affects the quality attributes
• The larger a component, the more complex it is
• The more public its internals are the more testable it is
• The more connectors there are the less maintainable the system is
![Page 11: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/11.jpg)
Flows
• The architect does not do detailed design within a certain level of component so the architecture simply shows a flow through from an in port to an out port
Process P1
System implementation S1.impl
Process P2C1
C5C3
flow path F5
flow path F7
![Page 12: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/12.jpg)
Styles
• An architecture style is a pattern that is repeated from one system to another because it solves a standard problem.
• A style is like a design pattern but on a higher, more abstract level.
![Page 13: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/13.jpg)
Example - Layered
• Many systems use the “layered” pattern as an underlying structure. The architecture for my infotainment example begins as a layered system.
• “Layered” requires that an element in one layer only communicate with elements in an adjacent layer. All relations either go up or down but not a mixture.
• This improves several attributes including maintainability, testability, and portability.
• The figure on the next page shows a layered architecture in which “uses” is the relationship.
• A component can use what is below it in the figure but can not use what is above it.
![Page 14: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/14.jpg)
Infotainment Architecture
http://www.drdobbs.com/embedded-systems/222600438;jsessionid=2CWUXIXKB5KHRQE1GHRSKH4ATMY32JVN
![Page 15: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/15.jpg)
Interactive systems
• Many of the software systems we develop are interactive or reactive.
• An action is taken that modifies the state of the system and the new state is reflected in what the user sees on the screen.
• Menus change, graphics change, text changes. • There are usually multiple windows and changes may be
made in several of these.• A popular architecture for this is Model/View/Controller
![Page 16: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/16.jpg)
MVC
• Model encapsulates all data• View shows some of the data; may have several views at the
same time• Controller responds to external events such as mouse clicks• Enhances modularity, modifiability, portability but not
performance
![Page 17: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/17.jpg)
Java Beans Application
![Page 18: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/18.jpg)
Views and Viewpoints
• One entity, three views, three different impressions• This is why we call the single picture of an architecture a
cartoon• We needs as many different views as are necessary to
communicate the complete picture
![Page 19: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/19.jpg)
Views and Viewpoints - 2
• A view is a representation of one or more structural aspects of an architecture that illustrates how the architecture addresses one or more concerns held by one or more of its stakeholders. [IEEE 1471]
• A viewpoint is a collection of patterns, templates, and conventions for constructing one type of view. It defines the stakeholders whose concerns are reflected in the viewpoint and the guidelines, principles, and template models for constructing its views. [IEEE 1471]
• The multiple pages in a building’s blueprint are different views from different viewpoints.
![Page 20: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/20.jpg)
Standard Viewpoints
• Functional – what does the system do – The use case diagrams give one view
• Information – what does the system do it to – class diagram gives data structures – sequence diagrams give flow of data
• Concurrency – how is work on the data sequenced – sequence and activity diagrams
![Page 21: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/21.jpg)
Architecture process
• Input => functional and non-functional requirements
• Generate quality attribute scenarios• Have stakeholders prioritize them• Choose high level style• Begin a recursive decent of decomposition• When appropriate level of detail is reached
evaluate the architecture against the scenarios
![Page 22: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/22.jpg)
Structure of scenario
• Source of stimulus (e.g., human, computer system, etc.)• Stimulus – a condition that needs to be considered• Environment - what are the conditions when the stimulus
occurs?• Artifact – what elements of the system are stimulated.• Response – the activity undertaken after arrival of the
stimulus• Response measure – when the response occurs it should be
measurable so that the requirement can be tested.
![Page 23: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/23.jpg)
Performance scenario
• Source of stimulus – typically an actor – Any user• Stimulus – clicks on save button• Environment – data has been entered into a matrix editor• Artifact – data matrix• Response – the data is written to the current file• Response measure – takes less than 2 seconds to write
• What other attributes for our problem?
![Page 24: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/24.jpg)
Decomposition• Our value computation is an interactive system. So we can start with MVC from
slide 16 and decompose from there.
Controller
ModelView
Controller
ModelData EditorSystem
menuProperties
editor
ControllerController
System Model
Controller
Editor ModelData EditorSystem menu
Properties editor
ControllerControllerController
![Page 25: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/25.jpg)
Extension
System Model
Controller
Editor ModelData EditorSystem menu
Properties editor
ControllerControllerController
System Model
Controller
Editor ModelData EditorSystem menu
Properties editor
ControllerControllerController
DataBase
![Page 26: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/26.jpg)
Design Structure Matrix
![Page 27: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/27.jpg)
DSMmodel view controller
model xview 1 xcontroller 1 1 x
Controller
Model
View
![Page 28: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/28.jpg)
Reference architectures
• A reference architecture is the architecture for a family of systems instead of just one.
• Defining a reference architecture involves looking for those common elements across all products in the family.
• The reference architecture often defines a standard set of viewpoints to be used in documenting the product specific architecture.
![Page 29: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/29.jpg)
DoD Reference Architecture
• This link points to a description of the DoD Reference Architecture
• http://dodcio.defense.gov/sites/diea/products/Ref_Archi_Description_Final_v1_18Jun10.pdf
• The document also points to other reference architectures.
![Page 30: CPSC 871 John D. McGregor Module 3 Session 1 Architecture.](https://reader035.fdocuments.in/reader035/viewer/2022062422/56649f395503460f94c55ff4/html5/thumbnails/30.jpg)
Reference architecture