# Incremental Construction for Scalable Component-Based Systems
## 4 Incremental Construction in CBD
### Architecture Description Languages
#### 4.2.2 The Basic Client-Server Component Model  
Many component models (e.g., ACME, SOFA and UML) support the client-server composition style. In this style, two components communicate by passing messages through their ports. The execution of the caller service is paused by making a call and resumed on receiving the response from the called component. In our basic client-server component model (basic-cs), a component is an AU with many required ports (r-ports) and provided ports (p-ports), as shown in Figure 15a.  
In basic-cs, a component with at least one p-port and zero or more r-ports is an eligible component. A port represents a message communication channel between a component and its environment. A signature (of a procedure/service) is associated with each port that represents the type of message allowed to be communicated through the port. A component's functionality is a set of services and a service is a relation between a sub-set of r-ports and one p-port (Figure 15b shows the functionality of a specific component _K_). For a component, an interaction (sending a request message and receiving a response message) on an r-port is initiated from within the computation code of a service in the component. In basic-cs, an r-port of a component may be related to one or many p-ports and a p-port may be related to zero or more r-ports, as shown in Figure 15b. A p-port not related to any r-port represents that there is no external service request initiated within the computation associated with the p-port. The behavior of a component can also be represented as a set of p-ports; a p-port is simply a function of related r-ports, as shown in Figure 15c for \(K\).  
In basic-cs, during execution, only one service of a component may be executed at a time. Figure 15c shows the execution semantics of a service of a component; a service interacts zero or more times on its r-ports. The execution of a service with associated r-ports is paused by requesting external services on its r-ports. The paused service resumes its execution after receiving a response message (control/data) from the requested service. In basic-cs, components are composed by port connection between ports with matching associated service signatures. For simplicity, we consider only one  
Figure 14: A basic-pnf System in Modelica: (**a**) First system and (**b**) Second system.  
Figure 15: (**a**) A component, (**b**) Port relations, (**c**) Execution semantics, and (**d**) A composite.  
connection for a port. A composite of two components is shown in Figure 15d; all unconnected ports are composite's ports and the behavior of the composite is a set of services (or unconnected p-ports).  
In Figure 15d, an initial system \(S_{0}\) (component \(A\)) is incremented \(inc_{0}\) (component \(C\)) by port connection and the composite \(AC\) is the incremented system \(S_{1}\). A compound service s5 relates the composite's p-port 'h' with the composite's r-port 'a'. As the relation of behavior containment between the two systems holds (\(B_{A}\subseteq B_{AC}\)), basic-cs component model supports incremental construction.  
In order to illustrate incremental construction, we consider constructing a system to evaluate the mathematical expression (\(c=a^{2}+b^{3}\)). We develop three components _Calc_ (to add two numbers), _sCom_ (to square a number) and _cCom_ (to cube a number) in ArchJava [47,48]; the desired system is constructed in two steps, as shown in Figure 16.