Why choose iPOJO?SimplicityTrying to create an OSGi-based application with services is challenging. The OSGi API is complex and a lot of knowledge about internal mechanisms has to be known to avoid synchronization issues. iPOJO provides a very simple development model; let's look: Code Block |
---|
| java |
---|
| java |
---|
1 | Providing a service |
---|
|
@Component
@Provides
public class MyServiceImplementation implements MyService {
...
}
|
Code Block |
---|
| java |
---|
| java |
---|
1 | Requiring a service |
---|
|
@Component
public class MyServiceConsumer {
@Requires
private MyService myservice;
// Just use your required service as any regular field
}
|
Isn't that easy? Providing and requiring OSGi services have never been so simple. PowerSupporting OSGi services is not the only feature of iPOJO. iPOJO provides many other features that to simplify developing sophisticated applications. For example, iPOJO supports configuring components with Configuration Admin, sending/receiving events with the Event Admin, remote configuration with JMX, and more. FlexibilityIs iPOJO missing a feature you need? No problem. iPOJO provides an extensibility mechanism that allows you to mange other (custom) requirements. You can easily adapt iPOJO for your own needs. Creating an extension does not require modifications to the core, you only need to implement a custom handler that will be plugged on your instance. Your handlers can also use any of the other iPOJO features. Portability iPOJO works on any R4.1 OSGi implementation. It also works on many Java virtual machines such as Oracle JRockit, JamVM, Dalvik (Android), and Mika. iPOJO only requires a J2ME Foundation 1.1 virtual machine. So, iPOJO can be embedded inside mobile phone applications or inside your washing machine. LightweightBeing powerful is great, but what about footprint and performances? iPOJO is small and was designed to stay small. The core size of iPOJO is approximately 205k (compared to 816k for Guice-Peaberry and 2112k for the minimal Spring-DM configuration). In addition to the core, you only deploy the features you require. For example, if you need proxy injection, just deploy the temporal dependency bundle (less than 70Kb). The run-time overhead of iPOJO is also small. On the Peaberry benchmark, iPOJO has very good performance: Code Block |
---|
Guice-Peaberry: 276.00 ns/call
iPOJO Service Dependency: 118.00 ns/call
Spring-DM: 2384.00 ns/call
iPOJO Temporal Dependency: 159.00 ns/call
iPOJO Temporal Dependency w/ proxy: 173.00 ns/call
|
For French readers, you can find additional benchmarks in chapter 10 of iPOJO - A flexible service-oriented component model for dynamic systems Debug & IntrospectionDevelopment supportDeveloping OSGi applications can quickly become a nightmare, when things are working as expected. iPOJO helps you debug your application (and it often happen). For starters, you can debug iPOJO components as normal OSGi applications (stack traces and line number are not modified). But thanks to iPOJO's introspection mechanisms, you can also know the structure of your application (which instance uses which service...), so you easily understand why a service dependency is not fulfilled, the value of properties, etc. Designing applicationsDesign supportiPOJO also provides an architecture description language to design applications in a flexible and hierarchic manner. Designed applications are expressed in terms of services and are natively dynamic, meaning they support implementation evolution and substitution. Moreover, iPOJO supports service isolation to get your own private service. ConclusionGive it a try!. For any questions or feedback, send an email on the users@felix.apache.org mailing list (send a mail to users-subscribe@felix.apache.org to subscribe). |