Information Technology Reference
In-Depth Information
Figure 2. DI and Grid service injection
nents. During gridification, JGRIM alters
some of them and their interactions by us-
ing metaservices, thus at runtime some op-
eration requests originated by applications
at this layer are handled by the Middleware
layer.
to tune Grid applications that give developers
control over the way their gridified applications
execute on a Grid.
Injecting Grid Services into
Conventional Applications
JGRIM assumes that applications are properly
componentized, which is the case of most Java
applications. This allows JGRIM to treat an in-
dividual application as a collection of interacting
components. The idea is to enhance these interac-
tions by using metaservices, for example to add
remoting, load balancing or security. In addition,
individual components can be enriched too, for
example to add parallelism, job scheduling, wrap
as a Web Service, etc.
Central to JGRIM is the concept of Dependency
Injection (DI) (Johnson, 2005). With DI, com-
ponents providing services can be transparently
injected into components that require these ser-
vices. JGRIM exploits DI by allowing developers
to inject metaservices into ordinary applications.
Essentially, JGRIM targets the “ease of gridifica-
tion versus flexible tuning” trade-off (Mateos et
al., 2008a), minimizing the requirement of code
modification when porting applications to the
Grid, nonetheless providing useful mechanisms
DI achieves higher decoupling in component-
based applications by having components de-
scribed through public interfaces and reducing
couplings by delegating the responsibility for
component creation and linking to a DI container
(Johnson, 2005). Put differently, components only
know each other's interfaces, but it is up to the
DI container to create and set (inject) into a cli-
ent component an instance of another (provider)
component implementing a required interface
(center of Figure). A DI container is a runtime
platform in charge of binding clients components
to providers components.
Consider an application that includes a topic
catalog ( BookService ) and a client component
( Client ) accessing it (see Figure 2). The catalog
may be implemented, for instance, by using
a relational database ( BookDB ). Client has to
setup a BookBD component by providing it with
initialization parameters, specifically the location
of the database, drivers, user name and password.
Search WWH ::




Custom Search