Click here to load reader

Ryan McAlister CONNECTORS. Introduction Integration and interaction As important as developing functionality More challenging decisions Transfer control

Embed Size (px)

Citation preview

  • Slide 1
  • Ryan McAlister CONNECTORS
  • Slide 2
  • Introduction Integration and interaction As important as developing functionality More challenging decisions Transfer control and data Can also provide services Persistence Invocation Messaging Transactions
  • Slide 3
  • Introduction Common misconception Just calls between two components Using large off-the-shelf components Connectors are used to communicate Wide range of connectors to use Service request to named recipients Broadcast to anyone listening Suspend current processing Allow component to continue processing
  • Slide 4
  • Introduction Different roles connectors play Different connector types available Roles each one can fulfill Variation points for each connector type Hints and guidelines about connectors Applicablity Strengths Drawbacks
  • Slide 5
  • Connectors In Action Application independent elements How without the what Abstraction and separation of concerns New terminology showing up Pipe = type of connector Filter = component
  • Slide 6
  • Connectors In Action High level view Components A and B communicate via a Unix pipe Doesnt give us all the properties of the pipe Pipe allows interaction of unformatted streams of data Single sender single receiver As task is to hand data to pipe Actual recipient is unimportant Send only once
  • Slide 7
  • Connectors In Action Change to where B can talk back to A Acknowledge data was received Add a pipe from B to A Keep trying until B receives the data Add data buffering to pipe Adding another component Even more pipes Causes substantial system downtime Not the most effective solution
  • Slide 8
  • Connectors In Action Change from unformatted byte stream to discrete, typed packets Pipes will not work Use an event bus connector Similar properties Loose component coupling Asynchronous communication Data buffering Differences Event bus is better suited for system adaptation
  • Slide 9
  • Connectors In Action
  • Slide 10
  • Connector Foundations Building blocks of connectors Managing the flow of control Changing the processor program counter Managing the flow of data Performing memory access Channels or ducts Link interacting components Ducts dont provide additional interaction services Simple connectors just form ducts between components Others augment ducts
  • Slide 11
  • Connector Foundations Simple connectors Implemented in programming languages One type of interaction service Composite connectors Several connectors and possibly components Provided as libraries and frameworks Combine many kinds of interactions
  • Slide 12
  • Connector Foundations FrameworkExplantiation Category Broad interaction role Type How interaction services are realized Dimensions Architecturally relevant details Values Set of values dimensions can take Species Particular connector instance
  • Slide 13
  • Connector Roles Four general classes of services Communication Coordination Conversion Facilitation Connector will provide one or more of these services Category level of Figure 5-3
  • Slide 14
  • Connector Roles - Communcation Communication services Transmission of data among components Examples Pass messages Exchange data Communicate results
  • Slide 15
  • Connector Roles - Coordination Coordination Services Supports transfer of control among components Interact by passing the thread of execution Examples Function calls Method invocations
  • Slide 16
  • Connector Roles - Conversion Conversion Services Transform the interaction Takes information from one and formats it to where the other can use it Fixes mismatches caused by incompatible assumptions Type, number, frequency and order of interactions with other components Allow components that haven't been tailored for each other conduct interactions Examples Conversion of data formats Wrappers for legacy components
  • Slide 17
  • Connector Roles - Facilitation Facilitation services Mediate and streamline component interaction Reduces interdependences among interaction components Examples Load balancing Scheduling services Concurrency control
  • Slide 18
  • Selecting Appropriate Connectors Perform these steps 1. Select the specific set of interacting components Different sets can have different interaction needs Focus solely on the components needed for connector 2. Determine the interaction services needed Identify the precise characteristics of the components interaction Study the components architectural description
  • Slide 19
  • Selecting Appropriate Connectors 3. Determine 8 connector types that will provide services needed Based on identified interaction services 4. Evaluate each connector type Study these connectors dimensions, subdimensions, and values Eliminate any types that would be deemed suboptimal
  • Slide 20
  • Selecting Appropriate Connectors 5. For the remaining connector types Set the values for the necessary dimensions and subdimensions Identify the best or most natural connectors Perform a trade-off analysis Possibly choosing a composite connector.
  • Slide 21
  • Selecting Appropriate Connectors Using values of dimensions from different connector types leads to a composite connector species Creating unprecedented composite connectors is not easy Requires deep understanding of the connectors complementary, orthogonal, and incompatible characteristics Could become misguided, suboptimal or completely ineffective
  • Slide 22
  • Detecting Mismatches
  • Slide 23
  • Four rules for combining connector dimensions Requires Cautions Restricts Prohibits
  • Slide 24
  • Detecting Mismatches - Requires Requires states that the choice of one dimension in one connector species mandates that another dimension be selected in another connector species. For example if a distributor and an adaptor connector are composed Distributors delivery requires that the adaptor support presentation conversion Requires is a chaining rule and is used as a starting point. An event connector the require delivery semantics also needs a notification dimension, which in turn requires cardinality, synchronicity and mode. Mandatory dimensions are bold, optional dimensions are not
  • Slide 25
  • Detecting Mismatches - Cautions Cautions rule indicates that certain combinations of values for two connector dimensions that are required to be used in tandem, while valid, may result in an unstable or unreliable connector. For exam ple, a component being invoked implicitly should not have multiple entry points since an implicit invocation mechanism cannot choose among the entry points.
  • Slide 26
  • Detecting Mismatches Restricts Restricts rule indicates that the two dimensions are not require to be used together at all times, and that there are certain combinations of their values that are invalid. For example, thread specific data access cannot use heavy- weight concurrency
  • Slide 27
  • Detecting Mismatches - Prohibits Prohibits rule is used to exclude any combination of two dimensions from being used and indicates total incompatibility of the dimensions. For example, stream delivery cannot be built on transactional atomicity Relatively few instances of prohibits
  • Slide 28
  • Detecting Mismatches Weve only discussed binary combinations of connector dimension, but the compatibility relations between dimensions are transitive. We could apply the rules to determine n-ary compatibility between dimensions.