## 5 Model Transformations
### Execution and Implementation of the Model Transformations
(**b**) Updated design that uses an enhanced connector. The existing design is easy to understand and implement, but if we need to add a third copy of the device to the system in the future, we should establish a third communication channel. However, adding a third channel will change the design of all the software component classes on the communication path. Figure 18b shows the updated design. Using the _Dev\({}_{1}\)/Dev\({}_{2}\)Src_ object, we can obtain requests for both devices and forward them into a single port by adding the device identification information to the requests. Then, the enhanced connector inside _Component\({}_{2}\)_ can multiplex the requests to the correct device by reading the device identification information. Compared to the original design, the updated design is more resilient against adding or removing devices. If we need to add a third device, we will not have to change the ports of the classes in the communication path (e.g., _Component\({}_{1}\)_, _Component\({}_{2}\)_). ### Case IV: Blocking Requests Depending on the Condition

In this case, an intermediate object between two ports is used to allow or block requests. Figure 19a shows the existing design. During runtime, when objects of these classes receive a request through the port that provides the interface, they check a particular condition. They forward the incoming request only if the checked condition holds. Otherwise, they block and drop the request. Figure 19b shows the updated design using an enhanced connector. We implement the required coordination behavior by checking the particular condition inside the connector behavior. We observed that the conditional forwarding and blocking of the requests is used

Figure 19: Blocking or forwarding requests depending on the runtime condition: (**a**) Existing design: Using an intermediate object for conditionally blocking the request. (**b**) Updated design: Using an enhanced connector that can conditionally block the request. Figure 18: Handling Redundant Devices on the Platform: (**a**) Existing design: Dedicated communication channel for each device. (**b**) Updated design: Single communication channel for multiple devices using an enhanced connector inside Component\({}_{2}\). in several places in the projects, and they are implemented as separate classes and objects. Enhanced connectors can replace these objects, simplifying the design. ### Case V: Choosing a Single Reply Among Many Providers

In this scenario, multiple identical devices can respond to a request. A software component that acts like the multiple destination sender connector sends the same request to all devices. When all the providers reply, the response from one of the providers is used according to a selection algorithm. Figure 20a shows the existing design, where the requester object is responsible for its own functionality, in addition to the responsibility of multicasting requests to four devices and choosing a reply. Figure 20b shows the updated design using an enhanced connector. The enhanced connector can perform multicasting of the request to each provider and then selection of the reply of a specific provider. We can decouple the requesting side from the selection algorithm and increase its reusability by using the enhanced connector. ### Case VI: Discriminating Between Multiple Requesters

Figure 21a shows the existing design for this case. In this case, a software component receives requests of the same type from multiple relay ports. There are _checker_ objects behind each relay port to which incoming requests are forwarded. The checker objects set the _source_ field of the requests depending on the relay port the message is received (e.g., _Checker\({}_{1}\)_ sets the source field to 1). Then, the provider object can drop or accept requests from specific requesters based on the source information set by the checker objects. Figure 21b shows the structure diagram for the updated design using an enhanced connector.