Software Connectors Software Architecture Importance of Connectors • Complex, distributed, multilingual, modern software system functionality and managing data is definitely undoubtedly very difficult • At the same time achieving integration and proper interaction between these components is also equally important and more challenging than just creating components • In modern systems this important job of interaction and connection is achieved by connectors Components and Connectors • Connector Component – – – – Components encapsulate functionality and data Components provide application-specific functionality Connectors encapsulate interaction Connectors provide application-independent interaction mechanisms – Connectors perform transfer of control and data among components. Basically they provide facilities to components – Persistence, invocation, messaging & transaction – Complex components results in making interaction critical 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 4 • Being application independent, connectors help us to understand how the system works without knowing what system does • Connectors support abstraction and separation of concerns • Many system properties can be derived from system connectors • Example of how connectors specify characteristics of the system – ‘Unix pipe connecting two components’ is the description of system which provide high- level view of the system – High level view specify model of the system and properties of communication but not all properties of pipe – It provides uniform stream of data, it consist of single interaction channel and facilitate only unidirectional data transfer Role of Connectors • Connectors facilitate components by providing different services: – – – – Communication Coordination Conversion and Facilitation • Based on these services connectors have four different roles – – – – Communicator Coordinator Convertor and Facilitator 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 • e.g. persistence • Separates communication from computation • May influence non-functional system characteristics – e.g. performance, scalability, security 7 Connectors as Coordinators • Determine computation control • Control delivery of data • Function call and method invocation are simple examples • Signal and load balancing connectors • Separates control from computation 8 Connectors as Converters • Enable interaction of independently developed, mismatched components • Mismatches based on interaction – – – – Type Number Frequency Order • Examples of converters – Adaptors – Wrappers 9 Connectors as Facilitators • Services like load balancing, concurrency control, scheduling services are part of communication • Enable interaction of components intended to interoperate – Mediate and streamline interaction • Govern access to shared information • Provide synchronization mechanisms – Critical sections – Monitors 10 A Framework for Classifying Connectors 11 Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. A Framework for Classifying Connectors • Framework for studying connectors is divided into different layers • Top layer is Category which represents the broad interaction role the connectors fulfill • 2nd layer is Type; which differentiate connectors based on the way in which the connector’s interact services are realized • 3rd layer is dimensions and sub dimensions. Dimensions are architecturally relevant details of each connector type • 4th & lowest layer in the connector framework is formed by the set of values a dimension can take Connector Types • • • • • • • • Procedure call Data access Event Stream Linkage Distributor Arbitrator Adaptor 13 Procedure Call Connectors • Transfers the control between two procedure/ subroutines by providing coordination service • Transfer data like return value and works as a communicator • Most widely used and best understood connectors Procedure Call Connectors 15 Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission. • Synchronous: instant reply is expected e.g. chatting • Asynchronous: time is provided for communication e.g. email • Cardinality: fan in and fan out – Connections available with the system • Accessibility: private, protected or public Event Connectors • Events are system or language level messages • Event is an instantaneous effect of the termination of an invocation of an operation on an object which occurs at that object’s location • Provides coordination and communication services • Creates virtual connection between components interested in same events • Dynamically this connection can appear or disappear based on component’s interest • Distributed applications with asynchronous communication used these connectors Event Connectors 18 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 • Transfer of data between heterogeneous components • Provides communication serves by transferring data • Provides conversion service • Data store can be temporary or persistent • Persistent Data denotes information that is infrequently accessed and not likely to be modified Data Access Connectors 20 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 • Tie the system components together • Establishes channel for communication or coordination • Once the channel is established, linkage connectors can disappear or remain in the system • Provides facilitation • Not a rich connector in terms of dimensions Linkage Connectors 22 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 • Majorly use for communication purpose only • Transferring large amount of data between autonomous processes • Streams are used in client server system with data transfer protocol to deliver result of computation • Can be Combined with data access connector for managing database of file storage • Can be combined with event connector to multiplex the delivery of large number of events Stream Connectors 24 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 • When components are aware of presence of other components but can not make assumption about their needs and state, arbitrator streamline system operates and resolves any conflicts (facilitation) and redirect the flow of data (coordination) • Multithreaded system for using shared memory uses synchronization and concurrency control to guarantee atomicity and consistency • Arbitrator also acts as a mediator to provide services like reliability and atomicity • Security, safety, trustworthiness is also provided by arbitrator connector Arbitrator Connectors 26 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 • Provides facility to support interaction between components that have not been designed to interoperate • It acts as convertor Adaptor Connectors 28 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 • Performs identification of interaction paths and subsequent routing of communication and coordination • These connectors does not act independently but provides support to other connectors • Distributed system exchanges information using distributed connectors • DNS routing, swiching Distributor Connectors 30 Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.