Architectural Styles Software Architecture Lecture 5 Copyright Richard N Taylor Nenad Medvidovic and Eric M Dashofy All rights reserv Software Architecture Foundations Theory and Practice 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 Infinite malleability of object internals System decomposition into sets of interacting agents Disadvantages Objects must know identities of servers Side effects in object method invocations 2 Software Architecture Foundations Theory and Practice Object Oriented LL 3 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice OO LL in UML 4 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Layered Style Hierarchical system organization Multi level client server Each layer exposes an interface API to be used by above layers Each layer acts as a Server service provider to layers above Client service consumer of layer s below Connectors are protocols of layer interaction Example operating systems Virtual machine style results from fully opaque layers 5 Software Architecture Foundations Theory and Practice Layered Style cont d Advantages Increasing abstraction levels Evolvability Changes in a layer affect at most the adjacent two layers Reuse Different implementations of layer are allowed as long as interface is preserved Standardized layer interfaces for libraries and frameworks 6 Software Architecture Foundations Theory and Practice Layered Style cont d Disadvantages Not universally applicable Performance Layers may have to be skipped Determining the correct abstraction level 7 Software Architecture Foundations Theory and Practice Layered Systems Virtual Machines 8 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Layered LL 9 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Client Server Style Components are clients and servers Servers do not know number or identities of clients Clients know server s identity Connectors are RPC based network interaction protocols 10 Software Architecture Foundations Theory and Practice Client Server LL 11 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Data Flow Styles Batch Sequential Separate programs are executed in order data is passed as an aggregate from one program to the next Connectors The human hand carrying tapes between the programs a k a sneaker net Data Elements Explicit aggregate elements passed from one component to the next upon completion of the producing program s execution Typical uses Transaction processing in financial systems The Granddaddy of Styles 12 Software Architecture Foundations Theory and Practice Batch Sequential A Financial Application 13 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Batch Sequential LL Not a recipe for a successful lunar mission 14 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Pipe and Filter Style Components are filters Transform input data streams into output data streams Possibly incremental production of output Connectors are pipes Conduits for data streams Style invariants Filters are independent no shared state Filter has no knowledge of up or down stream filters Examples UNIX shell signal processing Distributed systems parallel programming Example ls invoices grep e August sort 15 Software Architecture Foundations Theory and Practice Pipe and Filter cont d Variations Pipelines linear sequences of filters Bounded pipes limited amount of data on a pipe Typed pipes data strongly typed Advantages System behavior is a succession of component behaviors Filter addition replacement and reuse Possible to hook any two filters together Certain analyses Throughput latency deadlock Concurrent execution 16 Software Architecture Foundations Theory and Practice Pipe and Filter cont d Disadvantages Batch organization of processing Interactive applications Lowest common denominator on data transmission 17 Software Architecture Foundations Theory and Practice Pipe and Filter LL 18 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Blackboard Style Two kinds of components Central data structure blackboard Components operating on the blackboard System control is entirely driven by the blackboard state Examples Typically used for AI systems Integrated software environments e g Interlisp Compiler architecture 19 Software Architecture Foundations Theory and Practice Blackboard LL 20 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Rule Based Style Inference engine parses user input and determines whether it is a fact rule or a query If it is a fact rule it adds this entry to the knowledge base Otherwise it queries the knowledge base for applicable rules and attempts to resolve the query 21 Software Architecture Foundations Theory and Practice Rule Based Style cont d Components User interface inference engine knowledge base Connectors Components are tightly interconnected with direct procedure calls and or shared memory Data
View Full Document