Скачать презентацию Choosing Connectors Software Architecture Lecture 8 Copyright Скачать презентацию Choosing Connectors Software Architecture Lecture 8 Copyright

10c23404acfb97fa562abf5bbd1721b5.ppt

  • Количество слайдов: 20

Choosing Connectors Software Architecture Lecture 8 Copyright © Richard N. Taylor, Nenad Medvidovic, and Choosing Connectors Software Architecture Lecture 8 Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.

Software Architecture: Foundations, Theory, and Practice Role and Challenge of Software Connectors How do Software Architecture: Foundations, Theory, and Practice Role and Challenge of Software Connectors How do we enable Attach adapter to A or components. Introduce B to Separate B’s. B“essence” A and interact? intermediate form from its packaging Publish. Provide B with abstraction Transform converter import/export fly of A’s on the Maintain multiple Negotiate to find What is versions of A common form for answer? B multilingual Make Change A’s form to B’s form the right. A and B 2

Software Architecture: Foundations, Theory, and Practice How Does One Select a Connector? l l Software Architecture: Foundations, Theory, and Practice How Does One Select a Connector? l l Determine a system’s interconnection and interaction needs u Software interconnection models can help Determine roles to be fulfilled by the system’s connectors u Communication, coordination, conversion, facilitation For each connector u Determine its appropriate type(s) u Determine its dimensions of interest u Select appropriate values for each dimension For multi-type, i. e. , composite connectors u Determine the atomic connector compatibilities 3

Software Architecture: Foundations, Theory, and Practice Simple Example l l l System components will Software Architecture: Foundations, Theory, and Practice Simple Example l l l System components will execute in two processes on the same host u Mostly intra-process u Occasionally inter-process The interaction among the components is synchronous The components are primarily computation-intensive u There are some data storage needs, but those are secondary 4

Software Architecture: Foundations, Theory, and Practice Simple Example (cont’d) Ø Ø Ø Select procedure Software Architecture: Foundations, Theory, and Practice Simple Example (cont’d) Ø Ø Ø Select procedure call connectors for intra-process interaction Combine procedure call connectors with distributor connectors for inter-process interaction Ø RPC Select the values for the different connector dimensions Ø What are the appropriate values? Ø What values are imposed by your favorite programming language(s)? 5

Software Architecture: Foundations, Theory, and Practice Procedure Call Connectors Revisited 6 Software Architecture: Foundations, Software Architecture: Foundations, Theory, and Practice Procedure Call Connectors Revisited 6 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 Distributor Connectors Revisited 7 Software Architecture: Foundations, Theory, Software Architecture: Foundations, Theory, and Practice Distributor Connectors Revisited 7 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 Two Connector Types in Tandem Select the appropriate Software Architecture: Foundations, Theory, and Practice Two Connector Types in Tandem Select the appropriate values for PC and RPC! 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 Software Interconnection Models l l l Interconnection models Software Architecture: Foundations, Theory, and Practice Software Interconnection Models l l l Interconnection models (IM) as defined by Perry u Unit interconnection u Syntactic interconnection u Semantic interconnection All three are present in each system Are all equally appropriate at architectural level? 9

Software Architecture: Foundations, Theory, and Practice Unit Interconnection l l Defines relations between system’s Software Architecture: Foundations, Theory, and Practice Unit Interconnection l l Defines relations between system’s units u Units are components (modules or files) u Basic unit relationship is dependency l Unit-IM = ({units}, {“depends on”}) Examples u Determining context of compilation l e. g. , C preprocessor l IM = ({files}, {“include”}) u Determining recompilation strategies l e. g. , Make facility l IM = ({compile_units}, {“depends on”, “has changed”}) u System modeling l e. g. , RCS, DVS, SCCS l IM = ({systems, files}, {“is composed of”}) 10

Software Architecture: Foundations, Theory, and Practice Unit Interconnection Characteristics l l l Coarse-grain interconnections Software Architecture: Foundations, Theory, and Practice Unit Interconnection Characteristics l l l Coarse-grain interconnections u At level of entire components Interconnections are static Does not describe component interactions u Focus is exclusively on dependencies 11

Software Architecture: Foundations, Theory, and Practice Syntactic Interconnection l l Describes relations among syntactic Software Architecture: Foundations, Theory, and Practice Syntactic Interconnection l l Describes relations among syntactic elements of programming languages u Variable definition/use u Method definition/invocation l IM = ( {methods, types, variables, locations}, {“is def at”, “is set at”, “is used at”, “is del from”, “is changed to”, “is added to”}) Examples u Automated software change management l e. g. , Interlisp’s masterscope u Static analysis l e. g. , Detection of unreachable code by compilers u Smart recompilation l Changes inside unit recompilation of only the changes u System modeling l Finer level of granularity than unit-IM 12

Software Architecture: Foundations, Theory, and Practice Syntactic Interconnection Characteristics l l l Finer-grain interconnections Software Architecture: Foundations, Theory, and Practice Syntactic Interconnection Characteristics l l l Finer-grain interconnections u At level of individual syntactic objects Interconnections are static & dynamic Incomplete interconnection specification u Valid syntactic interconnections may not be allowed by semantics u Operation ordering, communication transactions l e. g. , Pop on an empty stack u Violation of (intended) operation semantics l e. g. , Trying to use calendar add operation to add integers 13

Software Architecture: Foundations, Theory, and Practice Semantic Interconnection l l l Expresses how system Software Architecture: Foundations, Theory, and Practice Semantic Interconnection l l l Expresses how system components are meant to be used u Component designers’ intentions Captures how system components are actually used u Component users’ (i. e. , system builders’) intention Interconnection semantics can be formally specified u Pre- & post-conditions u Dynamic interaction protocols (e. g. CSP, FSM) l IM = ({methods, types, variables, . . . , predicates}, {“is set at”, “is used at”, “calls”, “called by”, . . . , “satisfies”}) 14

Software Architecture: Foundations, Theory, and Practice Example of Semantic Interconnection connector Pipe = role Software Architecture: Foundations, Theory, and Practice Example of Semantic Interconnection connector Pipe = role Writer = write Writer П close role Reader = let Exit. Only = close in let Do. Read = (read Reader read-eof Exit. Only) in Do. Read П Exit. Only glue = let Read. Only = Reader. read Read. Only Reader. read-eof Reader. close in let Write. Only = Writer. write Write. Only Writer. close in Writer. write glue Reader. read glue Writer. close Read. Only Reader. close Write. Only 15 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 Semantic Interconnection Characteristics l l l Builds on Software Architecture: Foundations, Theory, and Practice Semantic Interconnection Characteristics l l l Builds on syntactic interconnections Interconnections are static & dynamic Complete interconnection specification u Specifies both syntactic & semantic interconnection validity Necessary at level of architectures u Large components u Complex interactions u Heterogeneity u Component reuse What about ensuring other properties of interaction? u Robustness, reliability, security, availability, . . . 16

Software Architecture: Foundations, Theory, and Practice Composing Basic Connectors l l l In many Software Architecture: Foundations, Theory, and Practice Composing Basic Connectors l l l In many systems a connector of multiple types may be required to service (a subset of) the components All connectors cannot be composed u Some are naturally interoperable u Some are incompatible u All are likely to require trade-offs The composition can be considered at the level of connector type dimensions and subdimensions 17

Software Architecture: Foundations, Theory, and Practice Connector Dimension Inter. Relationships l l Requires – Software Architecture: Foundations, Theory, and Practice Connector Dimension Inter. Relationships l l Requires – u Choice of one dimension mandates the choice of another Prohibits – u Two dimensions can never be composed into a single connector Restricts – u Dimensions are not always required to be used together u Certain dimension combinations may be invalid Cautions – u Combinations may result in unstable or unreliable connectors 18

Software Architecture: Foundations, Theory, and Practice Dimension Inter-Relationships 19 Software Architecture: Foundations, Theory, and Software Architecture: Foundations, Theory, and Practice Dimension Inter-Relationships 19 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 Well Known Composite Connectors l l Grid connectors Software Architecture: Foundations, Theory, and Practice Well Known Composite Connectors l l Grid connectors (e. g. , Globus) u Procedure call u Data access u Stream u Distributor Peer-to-peer connectors (e. g. , Bittorrent) u Arbitrator u Data access u Stream u Distributor Client-server connectors Event-based connectors 20