Khanderao on Emerging And Integration Technologies

Tuesday, October 05, 2010

Selectively turning off the service engines in Oracle SOA AS11

Thanks to the Spring based implementation of Oracle SOA AS11, if you are not using B2B or mediator or decision or any other service engine, you can turn it off by removing their reference beans in fabric's Spring config (fabric-config.xml). Just be careful though! You may accidently remove something that is needed :-) This may bring the memory consumption down by 100s of MBs.

Labels: ,

Add to Technorati Favorites

Save This Page on del.icio.us

Saturday, February 02, 2008

My recently published SOA World article covering OSGi's state of art and future

SOA World recently published another article co-authored by me. In this article on OSGi, we, Dave Chappell and me, cover some basics of OSGi and discuss its relationship with other emerging technologies and frameworks like SCA, Spring, etc. We also cover some work in the area of distributed OSGi and future direction of OSGi.

Labels: , , , , , , ,

Add to Technorati Favorites

Save This Page on del.icio.us

Wednesday, June 13, 2007

Spring apps on OSGI

In my post on April 6th, 2007 I mentioned about the availability of Spring OSGI’s first milestone. However, in that post I did not cover much of the details. Anyway, the specification of Spring-OSGI is now posted on Spring Framework’s site.



The specification mentions its goal to provide an “easier path to build Spring applications that can be deployed in an OSGi execution environment, and that can take advantage of the services offered by the OSGi framework”.

The Spring-OSGI effort targets to combine the best features of both OSGI and Spring. OSGI has its strength in providing a lightweight micro-kernel where modules (read “bundles” in OSGI) can be dynamically added or removed. OSGI also provides a better isolation. The isolation is useful to co-exist multiple version of the same service. It isolated the potential problems on class conflicts. Spring provides an easy to use framework based on DI and AOP powered with various services (Spring ecosystem). Thus the combination targets, (I am listing benefits listed in the specs into two separate buckets), to give benefits from both the worlds:

Benefits inherited from OSGI
· Better separation of application logic into modules
· The ability to deploy multiple versions of a module concurrently
· The ability to dynamically discover and use services provided by other modules in the system
· The ability to dynamically deploy, update and undeploy modules in a running system
Benefits inherited from Spring:
· Use of the Spring Framework to instantiate, configure, assemble, and decorate components within and across modules.
· A simple and familiar programming model for enterprise developers to exploit the features of the OSGi platform.
In a recent interview, Interface21’s CTO Andrian Colyer, elaborated a practical and interesting scenario of using the Spring-OSGI. If a service in use needs an upgrade, behind the scene, you can bring down the service and replace with the newer upgraded service without any glitch. Spring OSGI combination manages the switching of services in the background. Spring provides a stable proxy in this scenario while OSGI provides dynamic lifecycle and versioning.” SpringOSGI solves this problem not only for ‘stateless’ services but for ‘stateful’ services too.

We may see various service platforms leveraging this powerful combination. However, Spring-OSGi might not be the only app framework based on OSGI. e.g. OSGI based Microkernel servers currently offered by different vendors are not Spring based. In addition to Spring-OSGi combination, some independend work being done to map SCA and OSGI. Moreover, OSGI itself is going through further enhancement to support distributed case. Some ESB vendors may have a look at OSGI either for dynamic services. Anyway, With such different pieces working together, more powerful platforms may emerge. The combined platforms would be effectively used to build large and complex enterprise applications. (On a side note: There is another effort, JSR 312 for JBI 2.0, in java world to combine SCA and OSGI “like features” . I commented on the efforts in my earlier post )



Labels: , ,

Add to Technorati Favorites

Save This Page on del.icio.us

Friday, April 06, 2007

SpringOSGi M1 available for download...

This week SpringOSGI reached the first milestone. The availability to download it, added another OpenSource to OSGi(different than OGSI which is Open Grid Services Infrastructure) list of opensources.
http://sourceforge.net/project/showfiles.php?group_id=73357&package_id=227224

The list now goes on..Apache Felix, Equinox OSGi, KnopherFish OSGI, OXSA, Newton, and many others.

This year seems to be a good year to OSGI. Recently IBM and Cisco announced to develop Unified Communications and Collaboration(called UC2) platform based on OSGI. UC2 would not be an open source. So to increase the adoption by developers and industry, these companies would make UC2 freely available.

Anyway, coming back to OSGi which now has many mobile-telecom device vendors on its board. OSGIs start in 1999, it started with JSR-8 ( which was withdrawn). However, quite a few Mobile related JSRs like 232, 239, 246 (Mobile Specs) have come up based on works/concepts from OSGI ( and some JSRs like JSR 277 partially specified features thus became controversial) and some more are coming up JSR291 (Dynamic components) etc

Some of the concepts related to versioning, lifecycle managements, and various other services may find way beyond devices related to Web Services. Off-course, Webservices being stateless, there is already a debate whether 'lifecycle' management makes sense to Webservices or not. However, it all depends on what we makes sense as lifecycle management in the domain.

Labels: , ,

Add to Technorati Favorites

Save This Page on del.icio.us

Thursday, March 29, 2007

A free Guice from Google causing you a Guice vs Spring dilemma?


Whenever Google announces something it makes big news. No wonder when Google released its internal Java dependency injection (DI) framework called Guice (pronounced as Juice) to open source, it created a splash in developer community.

Dependency Injection is a pattern to separate an application class from the containers implementation. Another term commonly used for DI is InversionOfControl (IoC). However, IoC is a more generic term with varying interpretation depending upon what control is being inverted. Hence, more precise term being used here is a Dependency Injection. In case of DI, the framework’s container or assembler assumes the responsibility of delivering the required objects or their finder interfaces via constructor or methods. . Such decoupling makes it independent to container. Thus offering a flexible and movable implementation. Moreover, DI based implementations are very good for testing. One may provide mock up implementations and hence test objects which otherwise would be unreachable. A very popular framework Called Spring is a sterling example of such DI / IoC frameworks (http://www.springframework.org). Prior to the rise of DI based frameworks, Service Locator Pattern was commonly used () for locating required components. JNDI lookup is a classic example of this usage pattern.

So Guice is a DI framework. Guice injects constructors, fields and methods. It has some advanced features such as custom scopes, circular dependencies, and static member injection. Is this a path breaking and new disruptive technology? Off-course Not. Currently there already many frameworks like Pico, Nano, Avalon, Gravity, Spice, Jice, Yan and many others and most importantly a very popular Spring! You can find an exhaustive list of IoC based frameworks at http://java-source.net/open-source/containers

Guice developers published a comparison of Guice with Spring at http://code.google.com/p/google-guice/wiki/SpringComparison One of the key difference is how is the dependency defined/bound. Guice is uses Java annotations while Spring has on XML based beans registry.

A side effect of this dependency on Java annotations is you cannot use Guice with JDK versions earlier to JDK1.5 (J2SE 5) because Java Annotation (http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html) was introduced in JDk1.5 (J2SE 5).

Annotations are defined in a source code. Thus they introduce a design time dependency. You need to change the code whenever there is a change in configuration. Guice overcome this issue with properties for externalization. You can still add an implementation class in runtime from properties. The key is Guice does not enforce the externalization. So you have a choice.

A comparison paper from Guice Developers about Spring and Guice comments following about configurability and performance. "Spring supports two polar configuration styles: explicit configuration and auto-wiring. Explicit configuration is verbose but maintainable. Auto-wiring is concise but slow and not well suited to non-trivial applications. If you have 100s of developers and 100s of thousands of lines of code, auto-wiring isn't an option. Guice uses annotations to support a best-of-both-worlds approach which is concise but explicit (and maintainable)." We need to read these comment with a grain of salt. Performance impact depends when, where and how many objects being created and passed on. Are “objects being injected” created only during a startup or initializations or in every session? If the objects being created were not high in volume (or created only during startups or initializations) then the performance advantage of Guice would fade away.

Guice provides a faster, simpler and leaner framework for DI. However, Spring has much richer in functionalities in addition to DI. For example Spring XML can do transaction management, aspects, RMI exporting. With much richer functionality, Spring jars are comparatively larger in size than Guice. Guice promoters argue against Spring as it is being “bloated”. But what is a roadmap of Guice? It is always going to be a stripped down DI only framework? Or it will start building Spring like functionalities on top of DI? If Guice too adds more ingredients (read features), it may become equally “bloated”. Guice developers assert that performance is their primary driver. I hope that they maintain this commitment.

So, if you are looking for a DI only functionality. You can give a try to Guice. Google developers say that they are already using it in “mission critical” applications. With Google’s commitment you can have some assurance about a stability and continuity of this framework than many other smaller open source. However, in near future, Spring is still a popular choice for complex application developments. A more educated decision can be based on a feature-to-feature comparison for a type of application that you are building and what additional functionalities that you may need. I thing you know that “taste” is relative. So this Guice may or may not be tasty for all people and every time.

References:

Free Guice from Google

http://code.google.com/p/google-guice/

User Guide

http://docs.google.com/Doc?id=dd2fhx4z_5df5hw8

java Docs

http://google-guice.googlecode.com/svn/trunk/javadoc/index.html

IoC containers

http://java-source.net/open-source/containers

Spring and Guice comparison:

http://code.google.com/p/google-guice/wiki/SpringComparison

Using Spring in Guice: http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/spring/SpringIntegration.html

Service Locator Pattern

http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html

Dependency Injection using Spring

http://www.springframework.org/docs/reference/beans.html






Labels: , , ,

Add to Technorati Favorites

Save This Page on del.icio.us