## 6 End-to-End Example for Pattern-Based Application Development and Management
### Concretization of Architecture Diagrams During the Development Phase  
Based on the annotated pattern information, an application developer may identify potential cloud offerings and cloud providers to be used during the implementation of the application components. The pattern-based expression of requirements and desired component behavior thus enables the application architect and the application developer to use a common language and diagram format. Lengthy textual descriptions with unclear semantics are reduced. We argue that this will lead to fewer communication errors regarding requirements specification. Here, we discuss this selection of implementation artifacts and the resulting concretization of the application architecture diagram for the order processing and the product catalog component.  
To implement the process ordering component, the developer decides to manage the state of individual orders in a BPEL process ensuring the implementation of the _stateful component pattern_. The resulting application model is depicted in the right of Figure 20. To address duplicate messages, he decides to implement a message filter as a Web service as suggested by the _idempotent component pattern_. This message filter accepts messages send to the process ordering components and forwards it to the BPEL process. For these implementation components the application developer then requires to  
Figure 19: Enriched Diagram of the Web Shop Application.  
find an appropriate runtime environment. He identifies an application model with the Apache ODE BPEL process engine [52], and the Apache Tomcat application server [53], because it is annotated to both, the idempotent component and the stateful component patterns, as possible runtime. The application model then expects the availability of a Linux virtual machine. Since the order component handles business critical data, the developer decides to host it in a _private cloud_. Annotated with this cloud type, he finds an application model providing a Linux virtual machine in a private cloud based on VMware [54]. He combines this application model with the application components and the cloud offering application model to complete the application stack.  
Figure 21 depicts the concretization of the product catalog component from the architecture diagram to the application model. To implement this component, the developer decides to realize it as Java Web service [55] that accesses a MySQL database [56]. He finds an application model for a MySQL server and an Apache Tomcat application server, a runtime for Web services, annotated to the _relational data store pattern_ and the _stateful component pattern_. He decides to use this application model as runtime for the Web service and data base schema. As the product catalog component has to be elastic and hosts data that is publicly available, the developer further identifies a _public cloud_ as suitable hosting environment and finds an annotated application model for hosting the required Linux virtual machine on Amazon EC2. To implement the desired eventual consistent synchronization with the stock management component, the developer creates a shell script and configuration for the Linux virtual machine. This script is executed after certain time intervals as specified in the configuration file. It accesses the local MySQL server and issues a poll of catalog data from the stock management component. Because this synchronization is only performed after certain intervals, the desired eventual consistent synchronization is guaranteed.  
Figure 20: Concretization of the Order Processing Component.