In the context of cloud computing, one server is usually responsible to run multiple applications and a single application is spread across multiple servers. On the one hand, the applications need to be able to determine how the cloud environment should handle its execution, or even the execution of each one of its components. Yet, on the other hand, the applications should be decoupled from the middleware that executes them, enabling each one to evolve independently. Based on this scenario, it is possible to state that metadata-based frameworks are a suitable option for the interaction between the application and the services provided by the cloud, since it decouples the application from the environment and allows a transparent individual confi guration of each class. The goal of this chapter is to describe the essence of metadata-based frameworks and how they can be applied to cloud computing. It brings several examples of cloud computing frameworks and describes some design practices for the framework structure, scenarios that are suitable for the metadata-based approach and best practices for metadata confi guration. As a result, after reading this chapter, the reader should be able to understand the basic functioning of a metadata-based framework and why it is suitable for cloud applications.
Keywords
IntroductionCloud computing applications are executed across multiple servers, and this fact should be transparent to the developers, especially when the platform is provided as a service. Additionally, the application should interact with some cloud services, such as persistence and session management. To allow this transparency, the application should be decoupled from the cloud environment services. Since servers also execute many applications, another important requirement is to enable each application, or even each component, to confi gure how it should be handled by the cloud. Combining these two requirements, it is possible to conclude that the cloud provider should provide frameworks that, at the same time, abstract the cloud environment and allow a fl exible confi guration of how each application class should be handled.Many frameworks for developing cloud applications, such as Gaelyk [ 5 ], Objectify [ 6 ], Play Framework [ 7 ] and Guice [ 8 ], use metadata to allow a fi ne-grained confi guration of the application classes in the cloud environment. Gaelyk is a Groovy toolkit for web application development for Google App Engine (GAE) [ 5 ], which makes a classic use of metadata to map classes to persistent entities. Objectify implements the same mapping, but covering all features of the Google App Engine Datastore, using metadata also to defi ne entities, relationships and listeners.Another very interesting use for metadata can be found in Play Framework [ 7 ] where a web framework is deployed in GAE. It uses an annotation to schedule asynchronous jobs, which can run periodically or in an instant defi ned by expressions. Google Guice [ 8 ] uses metadata to inject dependencies from cloud serv...