Professional Documents
Culture Documents
Software Architecture
Software Architecture
! Lecture goals
! Understand importance of s/w architecture ! Create a vocab. for talking about system structure
2 !
1 !
3/8/10 !
! Software architecture is the blueprint for a software systems construction and evolution ! Design decisions encompass every facet of the system under development
! ! ! ! ! Structure Functional behavior Interaction Non-functional properties Implementation
3 !
4 !
2 !
3/8/10 !
Components
! Elements that encapsulate processing and data in a systems architecture ! Definition: A software comp. is an arch. entity that ! Encapsulates system functionality and/or data ! Restricts access via explicitly defined interfaces ! Has explicitly defined dependencies on its required execution context ! Components typically provide application-specific services
5 !
Connectors
! Notional definition:
! A software connector is an architectural building block that manages component interactions
! Connectors often simple proc. calls or shared data accesses, but much more sophisticated connectors are used in practice ! Connectors typically provide application-independent interaction facilities
6 !
3 !
3/8/10 !
Configurations
! Components and connectors are composed in a specific way in a given systems architecture to accomplish that systems objective ! Notional definition:
! An architectural configuration, or topology, is a set of specific associations between the components and connectors of a software systems architecture
7 !
8 !
4 !
3/8/10 !
10 !
5 !
3/8/10 !
Connectors as Communicators
! Main connector role. Supports data transmission:
! Different communication mechanisms
! e.g. procedure call, RPC, shared data access, message passing
11 !
Connectors as Coordinators
! Implement transfer of control ! Separates control from computation ! Orthogonal to other roles:
! Elements of control combined with communication, conversion and facilitation roles
12 !
6 !
3/8/10 !
Connectors as Converters
! Enable interaction of independently developed, mismatched components ! Mismatches based on interaction
! Type ! Number ! Frequency ! Order
! Examples of converters
! Conversion of data format ! Wrappers for legacy components
13 !
Connectors as Facilitators
! Enable interaction of components intended to interoperate
! Optimize or streamline interactions
! Synchronization mechanisms
! Monitors
14 !
7 !
3/8/10 !
Discussion
! Connectors are fundamental aspect of s/w arch. ! Allow arbitrarily complex interactions ! Connector libraries let developers to focus on application-specific issues ! Connector flexibility aids system evolution & nonfunctional properties
! Component addition, removal, replacement, reconnection, migration ! Reliability, scheduling, availability
15 !
Designing Architectures
8 !
3/8/10 !
17 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
18 !
9 !
3/8/10 !
Architectural Patterns
! An architectural pattern is a set of architectural design decisions that are applicable to a recurring design problem, and parameterized to account for different software development contexts in which that problem appears. ! Architectural patterns are similar to design patterns but applied at a much higher level
19 !
20 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
10 !
3/8/10 !
Model-View-Controller (MVC)
! Objective: Separation between information (M), presentation (V) and user interaction (C). ! When a model object value changes, a notification is sent to the view and to the controller.
! Thus, the view can update itself and the controller can modify the view if its logic so requires.
! When handling input from the user the windowing system sends the user event to the controller.
! If a change is required, the controller updates the model object.
21 !
Model-View-Controller
22 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
11 !
3/8/10 !
Sense-Compute-Control
Architectural Styles
! Architectural style: a named collection of architectural design decisions that
! are applicable in a given development context ! constrain specific architectural design decisions ! elicit beneficial qualities in the resulting system
24 !
12 !
3/8/10 !
! A semantic interpretation
! Compositions of elems have well-defined meanings
25 !
! Interpreter
! Event-based ! Publish-subscribe
! Peer-to-peer
! Blackboard ! Rule-based
26 !
13 !
3/8/10 !
28 !
14 !
3/8/10 !
Sense-Compute-Control LL
29 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
30 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
15 !
3/8/10 !
Object-Oriented Style
! Components are objects ! Data and associated operations ! Connectors are messages and method invocations ! Style invariants ! Objects are responsible for their internal representation integrity ! Internal representation is hidden from other objects ! Advantages ! Malleable object internals ! System decomposition into sets of interacting agents ! Disadvantages ! Objects must know identities of servers ! Side effects in object method invocations
31 !
Object-Oriented LL
32 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
16 !
3/8/10 !
Layered Style
! Hierarchical system organization
! Each layer exposes an interface (API) to be used by above layers
! Connectors are protocols for layer interaction ! Virtual machine style results from fully opaque layers
33 !
! Different layer implementations allowed as long as interface is preserved ! Standardized layer interfaces for libraries and frameworks
34 !
17 !
3/8/10 !
35 !
36 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
18 !
3/8/10 !
Client-Server Style
! ! ! ! Components: clients & servers Servers dont know number/identities of clients Clients know servers identity Connectors are based on network protocols
37 !
Client-Server LL
38 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
19 !
3/8/10 !
Data-Flow Styles
! Batch-sequential ! Pipe and Filter
39 !
Batch Sequential
! The Granddaddy of Styles
! Separate programs are executed in order; data is passed as an aggregate from one program to the next. ! Connectors: file accessors ! Data Elements: Explicit, aggregate elements passed from one component to the next upon completion of the producing programs execution.
40 !
20 !
3/8/10 !
Batch-Sequential LL
! Style invariants
! Filters are independent (no shared state) ! Filter has no knowledge of up- or down-stream filters
! Examples
! UNIX shell, signal processing
42 !
21 !
3/8/10 !
! Concurrent execution
43 !
44 !
22 !
3/8/10 !
45 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
46 !
23 !
3/8/10 !
Blackboard Style
! Two kinds of components
! Central data structure blackboard ! Components operating on the blackboard
Blackboard LL
48 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
24 !
3/8/10 !
Rule-Based Style
! Inference engine parses user input and determines whether it is a fact/rule or a query ! If a fact/rule, add this entry to the knowledge base
! Rules often take if (condition) then {action} form
! Otherwise, query the knowledge base for applicable rules and attempt to resolve the query
49 !
! Connectors:
! Components are tightly interconnected, with direct procedure calls and/or shared memory
! Data Elements:
! Facts and queries
50 !
25 !
3/8/10 !
51 !
Rule Based LL
52 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
26 !
3/8/10 !
Interpreter Style
! Basic Interpreter ! Mobile Code
53 !
54 !
27 !
3/8/10 !
55 !
Basic Interpreter LL
56 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
28 !
3/8/10 !
Mobile-Code Style
! Data elements become processing comps ! Components:
! Execution dock, which handles receipt of code and state; code compiler/interpreter
! Connectors:
! Network protocols and elements for packaging code and data for transmission
! Data Elements:
! Representations of code as data, program state, data
57 !
Mobile Code LL
Scripting languages (i.e. JavaScript, VBScript), ActiveX controls, embedded Word/Excel macros, cloud computing
58 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
29 !
3/8/10 !
Implicit Invocation
! Publish-Subscribe ! Event-Based
59 !
! Style invariants
! Announcers unaware of events effects ! No assumption about processing in response to events 60!
30 !
3/8/10 !
! Disadvantages
! Counter-intuitive system structure ! Components relinquish computation control to the system ! No knowledge of what components will respond to event ! No knowledge of order of responses
61 !
Publish-Subscribe
! Subscribers register/deregister to receive specific messages or specific content ! Publishers broadcast messages to subscribers either synchronously or asynchronously
62 !
31 !
3/8/10 !
Publish-Subscribe (contd)
! Components:
! Publishers, subscribers, proxies
! Connectors:
! Network protocols. Content-based subscription requires sophisticated connectors.
! Data Elements:
! Subscriptions, notifications, published information
! Topology:
! Subscribers connect to publishers or receive notifications from intermediaries
63 !
Pub-Sub LL
64 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
32 !
3/8/10 !
Event-Based Style
! Independent components asyn. emit and receive events over event buses ! Components:
! Independent, concurrent event generators and/or consumers
65 !
66 !
33 !
3/8/10 !
Event-based LL
67 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
Peer-to-Peer Style
! State and behavior are distributed among peers which can act as either clients or servers. ! Peers: independent components, having their own state and control thread. ! Connectors: Network protocols, often custom. ! Data Elements: Network messages
68 !
34 !
3/8/10 !
Peer-to-Peer LL
70 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
35 !
3/8/10 !
! ! ! ! ! !
What are the allowable structural patterns? What is the underlying computational model? What are the essential invariants of the style? What are common examples of its use? What are the (dis)advantages of using the style? What are the styles specializations?
71 !
SW Architecture Examples
36 !
3/8/10 !
73 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
74 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
37 !
3/8/10 !
75 !
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; 2008 John Wiley & Sons, Inc. Reprinted with permission. "
76 !
38 !
3/8/10 !
REST Principles
! [RP1] The key abstraction of information is a resource, named by an URL. Any information that can be named can be a resource ! Resources are logical entities
77 !
39 !
3/8/10 !
79 !
80 !
40 !
3/8/10 !
81 !
41 !
3/8/10 !
Data Elements
! The Web is a collection of uniquely-named resources. Each resource corresponds to some logical information ! URLs are resource IDs used to where the representation of the resource can be found ! Representations are data + representation metadata + resource metadata + control data
83 !
Connectors
! ! ! ! ! client server cache resolver tunnel libwww, libwww-perl libwww, Apache API, NSAPI browser cache, Akamai cache network bind (DNS lookup library) SOCKS, SSL after HTTP CONNECT
84 !
42 !
3/8/10 !
Components
! User agent
! e.g., browser
! Origin server
! e.g., Apache Server, Microsoft IIS
! Proxy
! Selected by client
! Gateway
! Squid, CGI, Reverse proxy ! Controlled by server
85 !
WWWs Architecture
! Webs architecture separate from its code ! No single piece of code implements the arch. ! Multiple implementations of a given component
! E.g., different browsers, servers, proxies, etc.
86 !
43 !
3/8/10 !
87 !
88 !
44 !
3/8/10 !
Product-Line Architecture
90 !
http://www.win.tue.nl/ipa/archive/springdays2005/Ommering1.pdf
45 !