Hi,

Blueprint does not aim to replace the entire Spring framework, only the
bean wiring stuff.
You can continue to use spring-sec, spr-data, spring-whatever but with the
Blueprint beans wiring mecanism (or even CDI with pax-cdi if you prefer
annotations) instead of the Spring one.
Blueprint wiring mecanism is pretty similar to Spring xml based one (you
just have different namespaces and a different location of your xml file).

Also DS and blueprint allow to export services between bundles, something
you didn't have to do with Spring because of the underlying architecture
(you can see OSGI service as a kind of web-service for the JVM).

For your transaction example, you have two alternatives: either using
aries-transaction where you declare the transactional aspect in your xml
descriptor, or use deltaspike-jpa @Transactional annotation (you can maybe
find an example of usage within OSGI on the pax-jpa repository).

Regards,

--


*Charlie Mordant*

*Full OSGI/EE stack with
Karaf:https://github.com/OsgiliathEnterprise/net.osgiliath.parent
<https://github.com/OsgiliathEnterprise/net.osgiliath.parent>*




2014-05-21 3:52 GMT+02:00 Tim Jones <[email protected]>:

> I am interested to hear views on where OSGI and Spring is heading. I
> realise
> this is a fairly broad topic but I think is worth discussing.
>
> I have noticed that a lot of answers on this forum and others suggest not
> using Spring but instead Blueprint or Declarative Services, particularly if
> starting from scratch.
>
> There are probably many arguments against using Spring ranging from 'Spring
> oriented technologies have a very unmodular streak in them' through to less
> active participation by SpringSource after ceasing work on their own OSGI
> container.
>
> However Spring has been adopted by many projects throughout the world,
> particularly in applications development. I have struggled to find good
> migration guides helping move a project from Spring to OSGI without Spring.
> For example there have been a few guides
> http://www.oracle.com/technetwork/articles/java/springtojavaee-522240.html
> to move from Spring to JEE. Is anyone aware of similar guides for migrating
> to OSGI.
>
> Take the project I currently work on as an example which uses Karaf/Felix +
> Spring + Camel + other. Spring is used amongst other things to anotate
> transactions, anotate classes (Component, Service, Repository,
> ManagedResource etc), autowire beans, reduce JDBC complexity (JdbcTemplate
> etc), define Camel routes, Spring security, Spring MVC, define transaction
> managers and data sources. This list is probably typical of many Spring
> applications. While some of these things have similar Blueprint/DS counter
> parts I would be interested in hearing how others have approached migrating
> away from Spring e.g. alternatives to anotating transactions?
>
>
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/OSGI-and-Spring-tp4033211.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Reply via email to