connectors

Click here to load reader

Upload: ianna

Post on 22-Feb-2016

21 views

Category:

Documents


0 download

DESCRIPTION

CONNECTORS. Ryan McAlister. Introduction. Integration and interaction As important as developing functionality More challenging decisions Transfer control and data Can also provide services Persistence Invocation Messaging Transactions. Introduction. Common misconception - PowerPoint PPT Presentation

TRANSCRIPT

CONNECTORS

Ryan McAlisterCONNECTORSIntroductionIntegration and interactionAs important as developing functionalityMore challenging decisionsTransfer control and dataCan also provide servicesPersistenceInvocationMessagingTransactions

IntroductionCommon misconceptionJust calls between two componentsUsing large off-the-shelf componentsConnectors are used to communicateWide range of connectors to useService request to named recipientsBroadcast to anyone listeningSuspend current processingAllow component to continue processing

IntroductionDifferent roles connectors playDifferent connector types availableRoles each one can fulfillVariation points for each connector typeHints and guidelines about connectorsApplicablityStrengthsDrawbacks

Connectors In ActionApplication independent elementsHow without the whatAbstraction and separation of concernsNew terminology showing upPipe = type of connectorFilter = componentConnectors 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

Connectors In ActionChange to where B can talk back to AAcknowledge data was receivedAdd a pipe from B to AKeep trying until B receives the dataAdd data buffering to pipeAdding another componentEven more pipesCauses substantial system downtimeNot the most effective solution

Connectors In ActionChange from unformatted byte stream to discrete, typed packetsPipes will not workUse an event bus connectorSimilar propertiesLoose component couplingAsynchronous communicationData bufferingDifferencesEvent bus is better suited for system adaptationConnectors In Action

Connector FoundationsBuilding blocks of connectorsManaging the flow of controlChanging the processor program counterManaging the flow of dataPerforming memory accessChannels or ductsLink interacting componentsDucts dont provide additional interaction servicesSimple connectors just form ducts between componentsOthers augment ducts

Connector FoundationsSimple connectorsImplemented in programming languagesOne type of interaction serviceComposite connectorsSeveral connectors and possibly componentsProvided as libraries and frameworksCombine many kinds of interactionsConnector FoundationsFrameworkExplantiation

CategoryBroad interaction roleTypeHow interaction services are realizedDimensionsArchitecturally relevant detailsValuesSet of values dimensions can takeSpeciesParticular connector instanceConnector RolesFour general classes of servicesCommunicationCoordinationConversionFacilitationConnector will provide one or more of these servicesCategory level of Figure 5-3Connector Roles - CommuncationCommunication servicesTransmission of data among componentsExamplesPass messagesExchange dataCommunicate resultsConnector Roles - CoordinationCoordination ServicesSupports transfer of control among componentsInteract by passing the thread of executionExamplesFunction callsMethod invocationsConnector Roles - ConversionConversion ServicesTransform the interactionTakes information from one and formats it to where the other can use itFixes mismatches caused by incompatible assumptionsType, number, frequency and order of interactions with other componentsAllow components that haven't been tailored for each other conduct interactionsExamplesConversion of data formatsWrappers for legacy components

Connector Roles - FacilitationFacilitation servicesMediate and streamline component interactionReduces interdependences among interaction componentsExamplesLoad balancingScheduling servicesConcurrency control Selecting Appropriate ConnectorsPerform these stepsSelect the specific set of interacting componentsDifferent sets can have different interaction needsFocus solely on the components needed for connectorDetermine the interaction services neededIdentify the precise characteristics of the components interactionStudy the components architectural descriptionSelecting Appropriate ConnectorsDetermine 8 connector types that will provide services neededBased on identified interaction servicesEvaluate each connector typeStudy these connectors dimensions, subdimensions, and valuesEliminate any types that would be deemed suboptimal

Selecting Appropriate ConnectorsFor the remaining connector typesSet the values for the necessary dimensions and subdimensionsIdentify the best or most natural connectorsPerform a trade-off analysisPossibly choosing a composite connector.Selecting Appropriate ConnectorsUsing values of dimensions from different connector types leads to a composite connector speciesCreating unprecedented composite connectors is not easyRequires deep understanding of the connectors complementary, orthogonal, and incompatible characteristicsCould become misguided, suboptimal or completely ineffectiveDetecting Mismatches

Detecting MismatchesFour rules for combining connector dimensionsRequiresCautionsRestrictsProhibits

Detecting Mismatches - RequiresRequires 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 composedDistributors delivery requires that the adaptor support presentation conversionRequires 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 notDetecting Mismatches - CautionsCautions 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.Detecting Mismatches RestrictsRestricts 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 concurrencyDetecting Mismatches - ProhibitsProhibits 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 atomicityRelatively few instances of prohibitsDetecting MismatchesWeve 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.