From bottom to top, this sample application will consist of three layers: persistence, service, and presentation. It can be seen in the next figure. The persistence layer is responsible for storing objects in a database. Transactions guarantee consistency of the database and provide isolation between concurrent requests. The service layer represents the business logic of this application. It consists of the validation service, complex event processing (CEP) service, and loan approval service. Finally, the presentation layer uses these services to provide functionality to the users in a user friendly fashion.