07_Software_Connectors_updated

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Software Connectors:

Software Connectors Software Architecture Lecture 7

What is a Software Connector?:

2 What is a Software Connector? Architectural element that models Interactions among components Rules that govern those interactions Simple interactions Procedure calls Shared variable access Complex & semantically rich interactions Client-server protocols Database access protocols Asynchronous event multicast Each connector provides Interaction duct(s) Transfer of control and/or data

Where are Connectors in Software Systems?:

3 Where are Connectors in Software Systems? Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Implemented vs. Conceptual Connectors:

4 Implemented vs. Conceptual Connectors Connectors in software system implementations Frequently no dedicated code Frequently no identity Typically do not correspond to compilation units Distributed implementation Across multiple modules Across interaction mechanisms

Implemented vs. Conceptual Connectors (cont’d):

5 Implemented vs. Conceptual Connectors (cont’d) Connectors in software architectures First-class entities Have identity Describe all system interaction Entitled to their own specifications & abstractions

Reasons for Treating Connectors Independently:

6 Reasons for Treating Connectors Independently Connector  Component Components provide application-specific functionality Connectors provide application-independent interaction mechanisms Interaction abstraction and/or parameterization Specification of complex interactions Binary vs. N-ary Interaction protocols

Treating Connectors Independently (cont’d):

7 Treating Connectors Independently (cont’d) Localization of interaction definition Extra-component system (interaction) information Component independence Component interaction flexibility

Benefits of First-Class Connectors:

8 Benefits of First-Class Connectors Separate computation from interaction Minimize component interdependencies Support software evolution At component-, connector-, & system-level Potential for supporting dynamism Facilitate heterogeneity Become points of distribution Aid system analysis & testing

An Example of Explicit Connectors:

9 An Example of Explicit Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

An Example of Explicit Connectors (cont’d):

10 An Example of Explicit Connectors (cont’d) ? Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Software Connector Roles:

11 Software Connector Roles Locus مكان of interaction among set of components Protocol specification (sometimes implicit) that defines its properties Types of interfaces it is able to mediate Assurances about interaction properties Rules about interaction ordering Interaction commitments التزام (e.g., performance) Roles Communication Coordination Conversion Facilitation

Connectors as Communicators:

12 Connectors as Communicators Main role associated with connectors Supports Different communication mechanisms e.g. procedure call, RPC, shared data access, message passing Constraints on communication structure/direction e.g. pipes Constraints on quality of service Separates communication from computation May influence non-functional system characteristics e.g. performance, scalability, security

Connectors as Coordinators:

13 Connectors as Coordinators Determine computation control (support transfer of control among components). Control delivery of data Separates control from computation Orthogonal to communication, conversion, and facilitation Elements of control are in communication, conversion and facilitation Ex: function calls

Connectors as Converters:

14 Connectors as Converters Enable interaction of independently developed, mismatched components Mismatches based on interaction Type Number Frequency Order Examples of converters Adaptors Wrappers

Connectors as Facilitators:

15 Connectors as Facilitators Enable interaction of components intended to interoperate Mediate and streamline interaction Govern access to shared information Ensure proper performance profiles e.g., load balancing Provide synchronization mechanisms Critical sections Monitors

Connector Types:

16 Connector Types Procedure call Data access Event Stream Linkage Distributor Arbitrator Adaptor

A Framework for Classifying Connectors:

17 A Framework for Classifying Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Procedure Call Connectors:

Procedure Call Connectors Model the flow of control among components through various invocation techniques. They are thus coordination connectors. Perform transfer of data among components through the use of parameters and return values. They are thus communication connectors. These connectors are most widely used and best understood. 18 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Procedure Call Connectors:

Procedure Call Connectors Ex: object-oriented methods, fork , call-back invocation in event-based systems. The following diagram shows the space of options available to a software engineer for constructing procedural call connectors. 19 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Procedure Call Connectors:

20 Procedure Call Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Event Connectors:

21 Event Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Affect the flow of control among components. They are thus coordination connectors. Once the event connector learns about the occurrence of an event, it generates messages (notifications) for all interested parties and yield control to the components for processing those messages. Messages can be generated upon the occurrence of a single event or a specific pattern of events. They are communication connectors.

Event Connectors:

22 Event Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Answer: Virtual connectors are formed between components interested in the same topics, and those connectors may appear and disappear dynamically depending on the components changing interests. Events based systems rely on the notion of time and ordering of actions. So dimensions as causality and synchronicity are critical in these connectors.

Event Connectors:

23 Event Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Example: Windowing application , where GUI inputs serve as the events that activate the system. Some events , such as interrupts, are triggered by hardware and then processed by software. The following diagram shows the space of options available to a software engineer for constructing event connectors.

Event Connectors:

24 Event Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Data Access Connectors:

25 Data Access Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Data access connectors allow components to access data maintained by a data store component. Therefore, they provide communication services. Data access connectors may perform translation of information being accessed, when there is a difference in the format of the required data and the format in which data is stored and provided. Therefore, they provide conversion services.

Data Access Connectors:

26 Data Access Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. The data can be stored persistently or temporarily, in which case the access mechanisms will vary. Example of persistent data access: query mechanisms , such as SQL for database access. Example of transient data access: heap and stack memory access and information caching. The following diagram shows the space of options available to a software engineer for constructing Data access connectors.

Data Access Connectors:

27 Data Access Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Linkage Connectors:

28 Linkage Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Linkage connectors are used to tie the system components together. They enable establishment of ducts (channels for communication and coordination) that are then used in higher level connectors. Linkage connectors provide Facilitation services. Ex: links between components and buses.

Linkage Connectors:

29 Linkage Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Stream Connectors:

30 Stream Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Streams transfer large amounts of data between processes. Therefore, they provide communication services. Streams can be combined with other types of connectors like data access connectors, event connectors, etc. Examples: Unix pipes.

Stream Connectors:

31 Stream Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Arbitrator Connectors:

32 Arbitrator Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. When components are aware of the presence of other components but cannot make assumptions about their needs and state, arbitrators resolve any conflicts. They provide facilitation services. Arbitrators redirect the flow of control. Therefore, they provide coordination services.

Arbitrator Connectors:

33 Arbitrator Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Example : multithreaded systems that require shared memory access use synchronization and concurrency control to guarantee consistency of operations. Arbitrators can ensure system trustworthiness by providing safety, security and reliability.

Arbitrator Connectors:

34 Arbitrator Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Adaptor Connectors:

35 Adaptor Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Adaptor connectors support interaction between components that have not been designed to interoperate. Adaptors provide conversion services. Adaptors employ transformations (i.e table look-ups) to match required services to the available facilities.

Adaptor Connectors:

36 Adaptor Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Example : a distributed system may rely on RPC for all interactions among components. If two interacting components are co-located within the same process, RPC may be converted to a local procedural call.

Adaptor Connectors:

37 Adaptor Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Distributor Connectors:

38 Distributor Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. Distributor connectors perform the identification of interaction paths and subsequent routing of communication and coordination information among components along these paths. They provide facilitation services. Distributor connectors never exist by themselves, but provide assistance to other connectors. DNS, routing, switching and other network services belong to this connector type.

Distributor Connectors:

39 Distributor Connectors Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Discussion:

40 Discussion Connectors allow modeling of arbitrarily complex interactions Connector flexibility aids system evolution Component addition, removal, replacement, reconnection, migration Support for connector interchange is desired Aids system evolution May not affect system functionality

Discussion:

41 Discussion Libraries of OTS connector implementations allow developers to focus on application-specific issues Difficulties Rigid connectors Connector “dispersion” in implementations

How Does One Select a Connector?:

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

Simple Example:

43 Simple Example System components will execute in two processes on the same host Mostly intra-process Occasionally inter-process The interaction among the components is synchronous The components are primarily computation-intensive There are some data storage needs, but those are secondary

Simple Example (cont’d):

44 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?

Composing Basic Connectors:

45 Composing Basic Connectors In many systems a connector of multiple types may be required to service (a subset of) the components All connectors cannot be composed Some are naturally interoperable Some are incompatible All are likely to require trade-offs The composition can be considered at the level of connector type dimensions and sub-dimensions

Connector Dimension Inter-Relationships:

46 Connector Dimension Inter-Relationships Requires – Choice of one dimension mandates the choice of another Prohibits – Two dimensions can never be composed into a single connector Restricts – Dimensions are not always required to be used together Certain dimension combinations may be invalid Cautions – Combinations may result in unstable or unreliable connectors

Dimension Inter-Relationships :

47 Dimension Inter-Relationships Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Well Known Composite Connectors:

48 Well Known Composite Connectors Grid connectors Procedure call Data access Stream Distributor Peer-to-peer connectors Arbitrator Data access Stream Distributor Client-server connectors Event-based connectors

Event-based data distribution connectors:

49 Event-based data distribution connectors Composition of four types of connectors: Event , data access, stream , distributor. Events arrive according to some periodic schedule or at discrete periodic intervals. Event-based distribution connectors often employ an asynchronous best effort delivery method for data. Event-based distribution connectors can access and mutate data at both the consumer and producer ends. Data is typically packaged into streams with bounded packet size and data buffering.