( Note: in practice, it’s probably a bad idea to run your tests on a different EE than your production environment, but that’s up to you). In this example, we will use Java 7 to develop our core application and Java 8 for our tests. OSGi bundles explicitly state their dependencies, and each bundle (module) can specify its Execution Environment. However, even if you don’t use OSGi at runtime, OSGi + Eclipse provides a very powerful way to structure your system at development time. OSGi provides excellent runtime modularity constructions. This is even possible if you are not using OSGi at runtime, but you won’t get the runtime validation (you’ll have to manage this yourself during deployment). At development time, the compiler will attempt to compile your bundle against the specified EE, and at runtime, OSGi would ensure that the proper execution environment is available to run your bundle. For example, if a bundle only uses J2SE-1.6 (it doesn’t use any of libraries or language features of >= 1.7), it could specify this. The key to this is the Execution Environment (EE). EEs are symbolic representations of Java Runtimes, and are relevant both at development time and run-time. Many developers I talk to say that their production environments (or more likely, their customer’s production environments) are very conservative, and are not approved for Java 7 deployment yet, let alone Java 8.īut what if these conservative customers don’t use all your features? What if you package your system in many different ways for many different uses? Could the new features - which will not be deployed on your conservative customers systems - be developed with Java8? If you are using OSGi, then the answer is yes! In a perfect world we would all be pushing forward with Java 8, but in reality, other requirements often get in the way. Java8 was released in mid-March and the Java 7 End Of Life plan has already been announced.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |