Implementation Techniques Software Architecture Lecture 16 Copyright Richard N Taylor Nenad Medvidovic and Eric M Dashofy All rights reserv Software Architecture Foundations Theory and Practice Objectives Concepts Implementation as a mapping problem Architecture implementation frameworks Evaluating frameworks Relationships between middleware frameworks component models Building new frameworks Concurrency and generative technologies Ensuring architecture to implementation consistency Examples Different frameworks for pipe and filter Different frameworks for the C2 style Application Implementing Lunar Lander in different frameworks 2 Software Architecture Foundations Theory and Practice Objectives Concepts Implementation as a mapping problem Architecture implementation frameworks Evaluating frameworks Relationships between middleware frameworks component models Building new frameworks Concurrency and generative technologies Ensuring architecture to implementation consistency Examples Different frameworks for pipe and filter Different frameworks for the C2 style Application Implementing Lunar Lander in different frameworks 3 Software Architecture Foundations Theory and Practice Recall Pipe and Filter Components filters organized linearly communicate through character stream pipes which are the connectors Filters may run concurrently on partial data In general all input comes in through the left and all output exits from the right 4 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy C 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Framework 1 stdio Standard I O framework used in C programming language Each process is a filter Reads input from standard input aka stdin Writes output to standard output aka stdout Also a third unbuffered output stream called standard error stderr not considered here Low and high level operations getchar putchar move one character at a time printf and scanf move and format entire strings Different implementations may vary in details buffering strategy etc 5 Software Architecture Foundations Theory and Practice Evaluating stdio Platform support Available with most if not all implementations of C programming language Operates somewhat differently on OSes with no concurrency e g MS DOS Fidelity Good support for developing P F applications but no restriction that apps have to use this style Matching assumptions Filters are processes and pipes are implicit Inprocess P F applications might require modifications Efficiency Whether filters make maximal use of concurrency is partially up to filter implementations and partially up to the OS 6 Software Architecture Foundations Theory and Practice Framework 2 java io Standard I O framework used in Java language Object oriented Can be used for in process or inter process P F applications All stream classes derive from InputStream or OutputStream Distinguished objects System in and System out for writing to process standard streams Additional capabilities formatting buffering provided by creating composite streams e g a Formatting Buffered InputStream 7 Software Architecture Evaluating java io Foundations Theory and Practice Matching assumptions Platform support Available with all Java implementations on many platforms Platform specific differences abstracted away Fidelity Good support for developing P F applications but no restriction that apps have to use this style Easy to construct intraand inter process P F applications Concurrency can be an issue many calls are blocking Efficiency Users have fine grained control over e g buffering Very high efficiency mechanisms memory mapped I O channels not available but are in java nio 8 Software Architecture Foundations Theory and Practice Recall the C2 Style Layered style with event based communication over two way broadcast buses Strict rules on concurrency dependencies and so on Many frameworks developed for different languages focus on two alternative Java frameworks here 9 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy C 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Framework 1 Lightweight C2 Framework 16 classes 3000 lines of code Components connectors extend abstract base classes Concurrency queuing handled at individual comp conn level Messages are request or notification objects 10 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy C 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Evaluating Lightweight C2 Matching assumptions Framework Platform support Available with all Java implementations on many platforms Fidelity Assists developers with many aspects of C2 but does not enforce these constraints Leaves threading and queuing policies up to individual elements Comp conn main classes must inherit from distinguished base classes All messages must be in dictionary form Efficiency Lightweight framework efficiency may depend on threading and queuing policy implemented by individual elements 11 Software Architecture Foundations Theory and Practice Framework 2 Flexible C2 Framework 73 classes 8500 lines of code Uses interfaces rather than base classes Threading policy for application is pluggable Message queuing policy is also pluggable 12 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy C 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Framework 2 Flexible C2 Framework 13 Software Architecture Foundations Theory and Practice Richard N Taylor Nenad Medvidovic and Eric M Dashofy C 2008 John Wiley Sons Inc Reprinted with permission Software Architecture Foundations Theory and Practice Evaluating Flexible C2 Framework Platform support Available with all Java implementations on many platforms Matching assumptions Fidelity Assists developers with many aspects of C2 but does not enforce these constraints Provides several alternative application wide threading and queuing policies Comp conn main classes must implement distinguished interfaces Messages can be any serializable object Efficiency User can easily swap out and tune threading and queuing policies without disturbing remainder of 14 application code Software
View Full Document