You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Joachim Rohde <ma...@joachimrohde.com> on 2008/09/17 02:04:12 UTC

Questions about building a web-application with OSGi

Hi everybody,

First of all, the text become a bit longer than expected, so if you 
don't want to read all of it, you can find my questions summarized at 
the end...

The more I read about OSGi the more confused I get at the moment. So it 
would be nice if someone could answer at least some of my numerous 
questions.

But first let me explain what I have in mind: I want to build a 
web-application that can be modularized via plugins. For that purpose I 
was thinking about a "basis" platform which allows to administrate 
plugins (installing / de-installing) in an administration-area. Let's 
assume I want to have two plugins. First a simple blog, that let's me 
publish articles and as a second plugin a simple shoutbox. Further we 
assume that the shoutbox should be implemented with JSF and Hibernate 
and the blog with Struts and iBatis. Both plugins should appear in a 
menu which is provided by the basis platform. In both plugins I also 
want to use Spring.

So I created a small web-application that starts Felix in embedded mode 
and deployed it on my Tomcat. Also installing a simple Hello-World 
bundle programmatically was not a problem.

After that I searched the web for integrating another web-application as 
an OSGi bundle and I stumbled upon ModuleFusion 
(http://code.google.com/p/modulefusion/) which seems to head into the 
right direction. First thing I noticed trying it out, was, that 
ModuleFusion starts the webserver as an OSGi-bundle.

Is it just a matter of taste to let the webserver be started by the OSGi 
framework or the OSGi framework be started by a web-application or are 
there some advantages / disadvantegs that I don't see yet?

After further investigating I stumpled upon Spring-DM which seems the 
way to go, if you want to use Spring within OSGi. Is it 
essential/advised to use Spring-DM or is there another possibility to 
use Spring within OSGi?

Right after that I read about "SpringSource Application Platform" which 
sounds quite like what I had in mind. Especially the possibility of 
migrating legacy web-applications  to there PAR-format, to take 
advantage of there platform. But I'm not sure, if it's not a bit 
overkill for my scenario.
Here again, I read, that the webserver is started by the platform.

And then there is Apache Sling, which is also using Felix. But honestly 
I am not quite sure, if I really got the idea of Sling and if it could 
be of any use for me. Can it?

So after all those questions I still don't know how to use e.g. Struts 
or JSF in an OSGi bundle.

I guess that's it what's currently on my mind.

My question summarized:
1) Should the webserver be started as an OSGi bundle or should the OSGi 
framework be started by an web-application?
2) If I want to use Spring in my application, do I have to use Spring-DM?
3) Will I need SpringSource Application Platform?
4) What is Sling exactly for?
5) Are there any tutorials / examples I haven't found yet, which 
demonstrates a simple web-application with e.g. Struts used within a plugin?

I would appreciate it, if someone could push me into the right direction.

Joachim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Questions about building a web-application with OSGi

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

I'm not an OSGi expert but a Sling committer, and we use OSGi in web
applications extensively there, so I'll try.

On Wed, Sep 17, 2008 at 2:04 AM, Joachim Rohde
<ma...@joachimrohde.com> wrote:
> ...But first let me explain what I have in mind: I want to build a
> web-application that can be modularized via plugins....

Pretty much what Sling does, so you might want to have a look at that
as an example.

> ...Is it just a matter of taste to let the webserver be started by the OSGi
> framework or the OSGi framework be started by a web-application or are there
> some advantages / disadvantegs that I don't see yet?...

I'd say it depends on your environment - a webapp is convenient if
you're in a webapp container environment, whereas for standalone,
runnable jar stuff you might not need a webapp container and the
former might be easier. Sling demonstrates both, in its launchpad/app
and launchpad/webapp modules.

> ...After further investigating I stumpled upon Spring-DM...

Cannot help you on the Spring parts, except maybe this blog post from
a colleague about using Spring in Sling:
http://dev.day.com/microsling/content/blogs/main/slingspringspling.html

> ...And then there is Apache Sling, which is also using Felix. But honestly I am
> not quite sure, if I really got the idea of Sling and if it could be of any
> use for me. Can it?...

Sling is a web framework that is built out of OSGi bundles, and uses a
Java Content Repository for content/data storage.

As I said it might be useful as an example, or you might build your
application on it if working with JCR suits your needs.

Hope this helps, although I'm obviously based towards Sling.
-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org