Ikuo Yamasaki | 1 Feb 01:31
Picon

Initial FrameworkAdmin commit into the incubator

Hi,

First of all, thank you for voting me as an Equinox Incubator Committer.

Although it took so long time since the company I'm working for 
is not a member of the Eclipse Foundation, finally I became one !

Now, I committed to CVS the initial FrameworkAdmin service, which I've been
working on. Here is a short description of what the service does
(part of the abstract of my short talk for EclipseCon 2007):

------------------
To date, the focus of the OSGi Service Platform Specifications has been to
standardize a runtime infrastructure. Therefore how to configure and launch
an OSGi framework is not addressed leaving scenarios such as bootstrapping
an OSGi framework on a clean system hard to manage in a framework
independent way.

The FrameworkAdmin service aims at configuring and launching an OSGi
framework in a framework independent way. This API enables to:
- configure a non-running framework on aspects like,
	- set of bundles to run,
	- Java VM location,
	- Java VM arguments,
	- launcher location, and so on.
- inspect a non-running framework to see which bundles are known of the system.
- launch a framework by the specified configuration.

------------------
The plugins I committed are as follows:
(Continue reading)

Jeff McAffer | 1 Feb 02:40
Picon

Re: Bundle Granularity?


My 2c

I'm in agreement on bundling making sense from a code/reuse/componentization point of view.  We use a simple rule.
        "If two bundles will never be shipped separately, combine them"
Your definition of "never" may change over time but that's ok.  What doesn't change?  In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.

Anyway, this is distinct from discussions of extensions vs services etc.  I actually disagree with Simon that this should impact what you do.  Yes there is one extension point definer but the extension point definer is the moral equivalent the bundle that defines a service *interface* not the instances of the service.  These are the people who define the contract.  In OSGi typically there is only one of a given service interface.  There is no particular need to pair extension use with Require-Bundle use.  Extension points can be moved between bundles as can service interface definitions so indeed it could be seen as a programming/design error to depend on extension point origin.

Jeff



Simon J Archer <sarcher-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:56 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>, equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
Subject
Re: [equinox-dev] Bundle Granularity?






Craig

I wanted to echo Oleg's points.  Deciding whether to have one bundle or two is a very similar decision to whether you should have one class or two.  The most important thing, in my opinion, is to model the problem appropriately, rather than trying to create less bundles in the hope of some performance gains.  The reality is that fine grained bundles are typically more flexible and more reusable than coarse grained bundles, but they are also more complicated to understand.

Something that I have observed is that people building bundles for the Eclipse platform tend to build less fine grained bundles than people building bundles for some other OSGi/Equinox application.  One reason for this, I believe, is Eclipse extension points: While an extension point allows you to achieve similar things to an OSGi service, there is only ever exactly one provider of a particular Eclipse extension point, whereas there can be many providers of a particular OSGi service.  Eclipse bundles are typically not composed of OSGi services, although that is not to say they cannot be used.  Instead the Eclipse platform tends to favor extension points.  Reasons for this include Eclipse's necessity for laziness, and another is Eclipse's origins and life before OSGi.

I tend to find that when I'm building bundles for Eclipse I use the Require-Bundle manifest header to describe my bundle's dependency on a particular bundle (that often declares an extension point to which I wish contribute), whereas when I am building bundles for OSGi/Equinox I use the Import-Package manifest header.  Require-Bundle encourages coarse grained dependencies, whereas Import-Package encourages fine grained dependencies.

I would suggest leaning towards fine grained bundles rather than coarse, since merging bundles is far easier than splitting bundles.

I hope this helps,

Simon


Oleg Besedin <obesedin-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:20 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
Subject
Re: [equinox-dev] Bundle Granularity?








Hi Craig,
Back when we were doing the runtime split for 3.2 I did some testing on how having code in separate plugins vs. one plugin impacts performance.

Performance-wise having code in separate bundles had small impact on startup time. To be more concrete, having an extra bundle on WinXP 2GHz 2Gb adds about 1ms to the "warm" startup time. The impact is more significant for the "cold" startup, but those are very hard to quanitfy. My guess would be 2 - 5 ms, but it is just a guess (variability of cold startups is too high).

What did seem to impact startup performance was the amount of code that had to be loaded. More features -> more code -> slower startup. Again, to put some numbers, on the system above having a few extra classes loaded in activators added 28 ms to the startup sime.

There was no detectable impact on the runtime performance. Memory impact was rather hard to measure reliable; from the common sense there should be very little cost memory-wise. As for threads, there is no relationship between the number of threads and number of bundles.

In my opinion, granularity of bundles should be determined more by things like:
- business considerations;
- need to keeping things compartmentalized / reusable;
- separation of work between developers / teams.

>From a technical side there is a small cost associated with having extra bundles, but it seems to be rather small. That said please don't create a bundle per class :-)

Sincerely,
Oleg Besedin


Craig Setera <craigjunk-1Lq0CT30SxYdnm+yROfE0A@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 08:00 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>


To
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
cc
Subject
[equinox-dev] Bundle Granularity?









I'm wondering if there are any rules of thumb in terms of the
granularity of bundles?  What are the advantages and disadvantages of
having fine grained bundles versus coarser grained bundles?  For
instance, what is the average cost of a bundle in terms of:

- Memory overhead?
- Classloader lookup times?
- Threads in the system?
- Other overhead?

The positive things I can think of include the ability for the system to
lazily load only the bundles that are actually necessary.  What are the
other advantages of finer grained bundles?

Thanks for any insights you can provide.
Craig

PS - I'm primarily talking about bundles in the context of the Eclipse
platform rather than at the Equinox framework level.
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Kim Moir | 1 Feb 04:16
Picon

Re: Submitted fix for next 3.3 I-Build


thanks!

Kim




Thomas Watson <tjwatson-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Sent by: platform-releng-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 04:46 PM

Please respond to
"Eclipse platform release engineering list."        <platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To
"Eclipse platform release engineering list." <platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
Subject
Re: [platform-releng-dev] Submitted fix for next 3.3 I-Build






Simon had released this fix and did the tagging before the Eclipse planning call today.  He was not aware of the new build policy we discussed in today's call.  I have reverted the map file to exclude this fix.  It will be included when I retag for the M5 warm-up build.

Tom



Kim Moir <Kim_Moir-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org>
Sent by: platform-releng-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 03:29 PM

Please respond to
"Eclipse platform release engineering list."        <platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To
"Eclipse platform release engineering list." <platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
Subject
Re: [platform-releng-dev] Submitted fix for next 3.3 I-Build








Simon, to clarify, this build is not a warm up for M5.  It's just a build to address the issues from the last build I20070130-0800 that impacted usability and test results.  From looking at the bug report, it doesn't appear  that this is a fix to address issues with the last build but rather to address an issue that has been open for a while.  Please test your change in the next nightly build, not tomorrow's integration build.

Please revert your map file change.

thanks :-)
Kim


"Simon Kaegi" <simon.kaegi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent by: platform-releng-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 03:06 PM

Please respond to
"Eclipse platform release engineering list."        <platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>


To
"Eclipse platform release engineering list." <platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
Subject
[platform-releng-dev] Submitted fix for next 3.3 I-Build









Equinox submitted a fix for tomorrows I build related to configuration of
the Jetty Http Service:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=170123

The core.map file has been updated.

-Simon

_______________________________________________
platform-releng-dev mailing list
platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev
_______________________________________________
platform-releng-dev mailing list
platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev
_______________________________________________
platform-releng-dev mailing list
platform-releng-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev

_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@...
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev
Rick Litton | 1 Feb 18:35

RE: Bundle Granularity?

Jeff McAffer wrote:

 

> In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.

 

On the subject of refactoring, perhaps you would consider removing the org.osgi.* packages inside org.eclipse.osgi bundle and instead use the core and compendium bundles from OSGi directly.  Not sure if there is any “legal” or technical impediment to this approach.

 

Rick Litton

From: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] On Behalf Of Jeff McAffer
Sent: Wednesday, January 31, 2007 5:40 PM
To: Equinox development mailing list
Subject: Re: [equinox-dev] Bundle Granularity?

 


My 2c

I'm in agreement on bundling making sense from a code/reuse/componentization point of view.  We use a simple rule.
        "If two bundles will never be shipped separately, combine them"
Your definition of "never" may change over time but that's ok.  What doesn't change?  In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.

Anyway, this is distinct from discussions of extensions vs services etc.  I actually disagree with Simon that this should impact what you do.  Yes there is one extension point definer but the extension point definer is the moral equivalent the bundle that defines a service *interface* not the instances of the service.  These are the people who define the contract.  In OSGi typically there is only one of a given service interface.  There is no particular need to pair extension use with Require-Bundle use.  Extension points can be moved between bundles as can service interface definitions so indeed it could be seen as a programming/design error to depend on extension point origin.

Jeff


Simon J Archer <sarcher-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:56 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>, equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

Subject

Re: [equinox-dev] Bundle Granularity?

 

 

 





Craig


I wanted to echo Oleg's points.  Deciding whether to have one bundle or two is a very similar decision to whether you should have one class or two.  The most important thing, in my opinion, is to model the problem appropriately, rather than trying to create less bundles in the hope of some performance gains.  The reality is that fine grained bundles are typically more flexible and more reusable than coarse grained bundles, but they are also more complicated to understand.


Something that I have observed is that people building bundles for the Eclipse platform tend to build less fine grained bundles than people building bundles for some other OSGi/Equinox application.  One reason for this, I believe, is Eclipse extension points: While an extension point allows you to achieve similar things to an OSGi service, there is only ever exactly one provider of a particular Eclipse extension point, whereas there can be many providers of a particular OSGi service.  Eclipse bundles are typically not composed of OSGi services, although that is not to say they cannot be used.  Instead the Eclipse platform tends to favor extension points.  Reasons for this include Eclipse's necessity for laziness, and another is Eclipse's origins and life before OSGi.


I tend to find that when I'm building bundles for Eclipse I use the Require-Bundle manifest header to describe my bundle's dependency on a particular bundle (that often declares an extension point to which I wish contribute), whereas when I am building bundles for OSGi/Equinox I use the Import-Package manifest header.  Require-Bundle encourages coarse grained dependencies, whereas Import-Package encourages fine grained dependencies.


I would suggest leaning towards fine grained bundles rather than coarse, since merging bundles is far easier than splitting bundles.


I hope this helps,


Simon


Oleg Besedin <obesedin-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:20 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

 

Subject

Re: [equinox-dev] Bundle Granularity?

 

 

 






Hi Craig,

Back when we were doing the runtime split for 3.2 I did some testing on how having code in separate plugins vs. one plugin impacts performance.


Performance-wise having code in separate bundles had small impact on startup time. To be more concrete, having an extra bundle on WinXP 2GHz 2Gb adds about 1ms to the "warm" startup time. The impact is more significant for the "cold" startup, but those are very hard to quanitfy. My guess would be 2 - 5 ms, but it is just a guess (variability of cold startups is too high).


What did seem to impact startup performance was the amount of code that had to be loaded. More features -> more code -> slower startup. Again, to put some numbers, on the system above having a few extra classes loaded in activators added 28 ms to the startup sime.


There was no detectable impact on the runtime performance. Memory impact was rather hard to measure reliable; from the common sense there should be very little cost memory-wise. As for threads, there is no relationship between the number of threads and number of bundles.


In my opinion, granularity of bundles should be determined more by things like:

- business considerations;

- need to keeping things compartmentalized / reusable;

- separation of work between developers / teams.

>From a technical side there is a small cost associated with having extra bundles, but it seems to be rather small. That said please don't create a bundle per class :-)


Sincerely,

Oleg Besedin


Craig Setera <craigjunk-1Lq0CT30SxYdnm+yROfE0A@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 08:00 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

 

To

equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

cc

 

Subject

[equinox-dev] Bundle Granularity?



 

 






I'm wondering if there are any rules of thumb in terms of the
granularity of bundles?  What are the advantages and disadvantages of
having fine grained bundles versus coarser grained bundles?  For
instance, what is the average cost of a bundle in terms of:

- Memory overhead?
- Classloader lookup times?
- Threads in the system?
- Other overhead?

The positive things I can think of include the ability for the system to
lazily load only the bundles that are actually necessary.  What are the
other advantages of finer grained bundles?

Thanks for any insights you can provide.
Craig

PS - I'm primarily talking about bundles in the context of the Eclipse
platform rather than at the Equinox framework level.
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Hal Hildebrand | 1 Feb 19:04
Picon
Favicon

RE: Bundle Granularity?

Speaking for myself, I would much rather these packages be kept in the bundle as I simply do not want to deal with setting up the class path to get the equinox framework to work.

There's really no need to refactor this from an infrastructure POV.


From Rick Litton <Rick.Litton <at> ktd-kyocera.com>
Sent Thu 2/1/2007 9:35 AM
To Equinox development mailing list <equinox-dev <at> eclipse.org>
Subject RE: [equinox-dev] Bundle Granularity?

Jeff McAffer wrote:

 

> In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.

 

On the subject of refactoring, perhaps you would consider removing the org.osgi.* packages inside org.eclipse.osgi bundle and instead use the core and compendium bundles from OSGi directly.  Not sure if there is any “legal” or technical impediment to this approach.

 

Rick Litton

From: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] On Behalf Of Jeff McAffer
Sent: Wednesday, January 31, 2007 5:40 PM
To: Equinox development mailing list
Subject: Re: [equinox-dev] Bundle Granularity?

 


My 2c

I'm in agreement on bundling making sense from a code/reuse/componentization point of view.  We use a simple rule.
        "If two bundles will never be shipped separately, combine them"
Your definition of "never" may change over time but that's ok.  What doesn't change?  In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.

Anyway, this is distinct from discussions of extensions vs services etc.  I actually disagree with Simon that this should impact what you do.  Yes there is one extension point definer but the extension point definer is the moral equivalent the bundle that defines a service *interface* not the instances of the service.  These are the people who define the contract.  In OSGi typically there is only one of a given service interface.  There is no particular need to pair extension use with Require-Bundle use.  Extension points can be moved between bundles as can service interface definitions so indeed it could be seen as a programming/design error to depend on extension point origin.

Jeff


Simon J Archer <sarcher-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:56 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>, equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

Subject

Re: [equinox-dev] Bundle Granularity?

 

 

 





Craig


I wanted to echo Oleg's points.  Deciding whether to have one bundle or two is a very similar decision to whether you should have one class or two.  The most important thing, in my opinion, is to model the problem appropriately, rather than trying to create less bundles in the hope of some performance gains.  The reality is that fine grained bundles are typically more flexible and more reusable than coarse grained bundles, but they are also more complicated to understand.


Something that I have observed is that people building bundles for the Eclipse platform tend to build less fine grained bundles than people building bundles for some other OSGi/Equinox application.  One reason for this, I believe, is Eclipse extension points: While an extension point allows you to achieve similar things to an OSGi service, there is only ever exactly one provider of a particular Eclipse extension point, whereas there can be many providers of a particular OSGi service.  Eclipse bundles are typically not composed of OSGi services, although that is not to say they cannot be used.  Instead the Eclipse platform tends to favor extension points.  Reasons for this include Eclipse's necessity for laziness, and another is Eclipse's origins and life before OSGi.


I tend to find that when I'm building bundles for Eclipse I use the Require-Bundle manifest header to describe my bundle's dependency on a particular bundle (that often declares an extension point to which I wish contribute), whereas when I am building bundles for OSGi/Equinox I use the Import-Package manifest header.  Require-Bundle encourages coarse grained dependencies, whereas Import-Package encourages fine grained dependencies.


I would suggest leaning towards fine grained bundles rather than coarse, since merging bundles is far easier than splitting bundles.


I hope this helps,


Simon


Oleg Besedin <obesedin-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:20 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

 

Subject

Re: [equinox-dev] Bundle Granularity?

 

 

 






Hi Craig,

Back when we were doing the runtime split for 3.2 I did some testing on how having code in separate plugins vs. one plugin impacts performance.


Performance-wise having code in separate bundles had small impact on startup time. To be more concrete, having an extra bundle on WinXP 2GHz 2Gb adds about 1ms to the "warm" startup time. The impact is more significant for the "cold" startup, but those are very hard to quanitfy. My guess would be 2 - 5 ms, but it is just a guess (variability of cold startups is too high).


What did seem to impact startup performance was the amount of code that had to be loaded. More features -> more code -> slower startup. Again, to put some numbers, on the system above having a few extra classes loaded in activators added 28 ms to the startup sime.


There was no detectable impact on the runtime performance. Memory impact was rather hard to measure reliable; from the common sense there should be very little cost memory-wise. As for threads, there is no relationship between the number of threads and number of bundles.


In my opinion, granularity of bundles should be determined more by things like:

- business considerations;

- need to keeping things compartmentalized / reusable;

- separation of work between developers / teams.

>From a technical side there is a small cost associated with having extra bundles, but it seems to be rather small. That said please don't create a bundle per class :-)


Sincerely,

Oleg Besedin


Craig Setera <craigjunk-1Lq0CT30SxYdnm+yROfE0A@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 08:00 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

 

To

equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

cc

 

Subject

[equinox-dev] Bundle Granularity?



 

 






I'm wondering if there are any rules of thumb in terms of the
granularity of bundles?  What are the advantages and disadvantages of
having fine grained bundles versus coarser grained bundles?  For
instance, what is the average cost of a bundle in terms of:

- Memory overhead?
- Classloader lookup times?
- Threads in the system?
- Other overhead?

The positive things I can think of include the ability for the system to
lazily load only the bundles that are actually necessary.  What are the
other advantages of finer grained bundles?

Thanks for any insights you can provide.
Craig

PS - I'm primarily talking about bundles in the context of the Eclipse
platform rather than at the Equinox framework level.
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________ equinox-dev mailing list equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org https://dev.eclipse.org/mailman/listinfo/equinox-dev
Thomas Watson | 1 Feb 19:08
Picon
Favicon

RE: Bundle Granularity?


There are a few reasons we package the core org.osgi classes in the framework implementation (org.eclipse.osgi)

1) Packaging convenience.  Having all the org.osgi.* classes packaged directly in the framework implementation reduces the amount jars you need to find and place on the classpath of the framework.

2) Technically we need to modify some of the classes provided by the OSGi Alliance to hook into our implementation.  For example, FrameworkUtil, AdminPermission and BundleSignerCondition.

3) Working on future reference implementations for the OSGi Alliance.  We need the ability to modify the API with enhancements that will become available in future public OSGi specifications.  For example, we are currently working on the Reference Implementation for OSGi R4.1 which introduces a small number new methods.

Tom




"Rick Litton" <Rick.Litton-o1VDy7GjCdobhb6IIWwbbQ@public.gmane.org>
Sent by: equinox-dev-bounces <at> eclipse.org

02/01/2007 11:35 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To
"Equinox development mailing list" <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
Subject
RE: [equinox-dev] Bundle Granularity?





Jeff McAffer wrote:
 
> In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.
 
On the subject of refactoring, perhaps you would consider removing the org.osgi.* packages inside org.eclipse.osgi bundle and instead use the core and compendium bundles from OSGi directly.  Not sure if there is any “legal” or technical impediment to this approach.
 

Rick Litton



From: equinox-dev-bounces <at> eclipse.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] On Behalf Of Jeff McAffer
Sent: Wednesday, January 31, 2007 5:40 PM
To: Equinox development mailing list
Subject: Re: [equinox-dev] Bundle Granularity?
 

My 2c

I'm in agreement on bundling making sense from a code/reuse/componentization point of view.  We use a simple rule.
       "If two bundles will never be shipped separately, combine them"
Your definition of "never" may change over time but that's ok.  What doesn't change?  In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.

Anyway, this is distinct from discussions of extensions vs services etc.  I actually disagree with Simon that this should impact what you do.  Yes there is one extension point definer but the extension point definer is the moral equivalent the bundle that defines a service *interface* not the instances of the service.  These are the people who define the contract.  In OSGi typically there is only one of a given service interface.  There is no particular need to pair extension use with Require-Bundle use.  Extension points can be moved between bundles as can service interface definitions so indeed it could be seen as a programming/design error to depend on extension point origin.

Jeff

Simon J Archer <sarcher-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:56 AM


Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>


To
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>, equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
Subject
Re: [equinox-dev] Bundle Granularity?

 


   






Craig

I wanted to echo Oleg's points.  Deciding whether to have one bundle or two is a very similar decision to whether you should have one class or two.  The most important thing, in my opinion, is to model the problem appropriately, rather than trying to create less bundles in the hope of some performance gains.  The reality is that fine grained bundles are typically more flexible and more reusable than coarse grained bundles, but they are also more complicated to understand.

Something that I have observed is that people building bundles for the Eclipse platform tend to build less fine grained bundles than people building bundles for some other OSGi/Equinox application.  One reason for this, I believe, is Eclipse extension points: While an extension point allows you to achieve similar things to an OSGi service, there is only ever exactly one provider of a particular Eclipse extension point, whereas there can be many providers of a particular OSGi service.  Eclipse bundles are typically not composed of OSGi services, although that is not to say they cannot be used.  Instead the Eclipse platform tends to favor extension points.  Reasons for this include Eclipse's necessity for laziness, and another is Eclipse's origins and life before OSGi.

I tend to find that when I'm building bundles for Eclipse I use the Require-Bundle manifest header to describe my bundle's dependency on a particular bundle (that often declares an extension point to which I wish contribute), whereas when I am building bundles for OSGi/Equinox I use the Import-Package manifest header.  Require-Bundle encourages coarse grained dependencies, whereas Import-Package encourages fine grained dependencies.

I would suggest leaning towards fine grained bundles rather than coarse, since merging bundles is far easier than splitting bundles.

I hope this helps,

Simon

Oleg Besedin <obesedin-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:20 AM


Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>


To
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
cc
 
Subject
Re: [equinox-dev] Bundle Granularity?

 


   







Hi Craig,
Back when we were doing the runtime split for 3.2 I did some testing on how having code in separate plugins vs. one plugin impacts performance.

Performance-wise having code in separate bundles had small impact on startup time. To be more concrete, having an extra bundle on WinXP 2GHz 2Gb adds about 1ms to the "warm" startup time. The impact is more significant for the "cold" startup, but those are very hard to quanitfy. My guess would be 2 - 5 ms, but it is just a guess (variability of cold startups is too high).

What did seem to impact startup performance was the amount of code that had to be loaded. More features -> more code -> slower startup. Again, to put some numbers, on the system above having a few extra classes loaded in activators added 28 ms to the startup sime.

There was no detectable impact on the runtime performance. Memory impact was rather hard to measure reliable; from the common sense there should be very little cost memory-wise. As for threads, there is no relationship between the number of threads and number of bundles.

In my opinion, granularity of bundles should be determined more by things like:
- business considerations;
- need to keeping things compartmentalized / reusable;
- separation of work between developers / teams.

>From a technical side there is a small cost associated with having extra bundles, but it seems to be rather small. That said please don't create a bundle per class :-)

Sincerely,
Oleg Besedin

Craig Setera <craigjunk-1Lq0CT30SxYdnm+yROfE0A@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 08:00 AM


Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

 


To
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
cc
 
Subject
[equinox-dev] Bundle Granularity?



   







I'm wondering if there are any rules of thumb in terms of the
granularity of bundles?  What are the advantages and disadvantages of
having fine grained bundles versus coarser grained bundles?  For
instance, what is the average cost of a bundle in terms of:

- Memory overhead?
- Classloader lookup times?
- Threads in the system?
- Other overhead?

The positive things I can think of include the ability for the system to
lazily load only the bundles that are actually necessary.  What are the
other advantages of finer grained bundles?

Thanks for any insights you can provide.
Craig

PS - I'm primarily talking about bundles in the context of the Eclipse
platform rather than at the Equinox framework level.
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Rick Litton | 1 Feb 20:22

RE: Bundle Granularity?

Hi Tom,

 

Please refer to my responses below.

 

Rick Litton

From: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] On Behalf Of Thomas Watson
Sent: Thursday, February 01, 2007 10:09 AM
To: Equinox development mailing list
Subject: RE: [equinox-dev] Bundle Granularity?

 


There are a few reasons we package the core org.osgi classes in the framework implementation (org.eclipse.osgi)

1) Packaging convenience.  Having all the org.osgi.* classes packaged directly in the framework implementation reduces the amount jars you need to find and place on the classpath of the framework.
-> I was assuming that the osgi bundles will be auto-started and that the required packages are exported which can then be imported by org.eclipse.osgi.  I haven’t actually done this but I think it should work.
2) Technically we need to modify some of the classes provided by the OSGi Alliance to hook into our implementation.  For example, FrameworkUtil, AdminPermission and BundleSignerCondition.

-> Can we get away with just extending the osgi interfaces?  I guess I find changing someone else’s framework classes/interfaces unappealing.

3) Working on future reference implementations for the OSGi Alliance.  We need the ability to modify the API with enhancements that will become available in future public OSGi specifications.  For example, we are currently working on the Reference Implementation for OSGi R4.1 which introduces a small number new methods.

-> Personally, I think that this is even an important consideration.  Switching OSGi R4 bundles with OSGi R4.1 ones will be a “snap” (hopefully) when they become available.  Like everyone else, I suppose OSGi will also provide maintenance or versioned releases to fix defects, etc.  It would be expedient to simply switch to those versioned ones without having to release an Equinox distro in response.  In this sense, tight coupling has its disadvantages in my view.

Tom



"Rick Litton" <Rick.Litton-o1VDy7GjCdobhb6IIWwbbQ@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

02/01/2007 11:35 AM

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

To

"Equinox development mailing list" <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

 

Subject

RE: [equinox-dev] Bundle Granularity?

 

 

 




Jeff McAffer wrote:
 
> In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.
 
On the subject of refactoring, perhaps you would consider removing the org.osgi.* packages inside org.eclipse.osgi bundle and instead use the core and compendium bundles from OSGi directly.  Not sure if there is any “legal” or technical impediment to this approach.
 

Rick Litton

 


From: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] On Behalf Of Jeff McAffer
Sent:
Wednesday, January 31, 2007 5:40 PM
To:
Equinox development mailing list
Subject:
Re: [equinox-dev] Bundle Granularity?

 

My 2c


I'm in agreement on bundling making sense from a code/reuse/componentization point of view.  We use a simple rule.

       "If two bundles will never be shipped separately, combine them"

Your definition of "never" may change over time but that's ok.  What doesn't change?  In Eclipse we have continually refactored bundles.  In 3.2 the Runtime bundle was split into 5 or 6 bundles.  In 3.0 the UI was split into 7.  This was driven by actual usecases and requirements.  It turns out that one of the key factors in the simplicity/difficulty of doing that refactoring was Java package naming!  We got hosed a couple of times by lumping fundamentally unrelated things together in the same Java package.  org.eclipse.core.runtme for example.  When we went to refactor we ended up needing to split the same package over multiple bundles.  This is possible but can be ugly and in the end results in some unfortunate legacy naming glitches.


Anyway, this is distinct from discussions of extensions vs services etc.  I actually disagree with Simon that this should impact what you do.  Yes there is one extension point definer but the extension point definer is the moral equivalent the bundle that defines a service *interface* not the instances of the service.  These are the people who define the contract.  In OSGi typically there is only one of a given service interface.  There is no particular need to pair extension use with Require-Bundle use.  Extension points can be moved between bundles as can service interface definitions so indeed it could be seen as a programming/design error to depend on extension point origin.


Jeff

Simon J Archer <sarcher-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:56 AM

 

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

 

To

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>, equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

Subject

Re: [equinox-dev] Bundle Granularity?


 

 

 

 






Craig


I wanted to echo Oleg's points.  Deciding whether to have one bundle or two is a very similar decision to whether you should have one class or two.  The most important thing, in my opinion, is to model the problem appropriately, rather than trying to create less bundles in the hope of some performance gains.  The reality is that fine grained bundles are typically more flexible and more reusable than coarse grained bundles, but they are also more complicated to understand.


Something that I have observed is that people building bundles for the Eclipse platform tend to build less fine grained bundles than people building bundles for some other OSGi/Equinox application.  One reason for this, I believe, is Eclipse extension points: While an extension point allows you to achieve similar things to an OSGi service, there is only ever exactly one provider of a particular Eclipse extension point, whereas there can be many providers of a particular OSGi service.  Eclipse bundles are typically not composed of OSGi services, although that is not to say they cannot be used.  Instead the Eclipse platform tends to favor extension points.  Reasons for this include Eclipse's necessity for laziness, and another is Eclipse's origins and life before OSGi.


I tend to find that when I'm building bundles for Eclipse I use the Require-Bundle manifest header to describe my bundle's dependency on a particular bundle (that often declares an extension point to which I wish contribute), whereas when I am building bundles for OSGi/Equinox I use the Import-Package manifest header.  Require-Bundle encourages coarse grained dependencies, whereas Import-Package encourages fine grained dependencies.


I would suggest leaning towards fine grained bundles rather than coarse, since merging bundles is far easier than splitting bundles.


I hope this helps,


Simon

Oleg Besedin <obesedin-G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 10:20 AM

 

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

 

To

Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

cc

 

Subject

Re: [equinox-dev] Bundle Granularity?


 

 

 

 







Hi Craig,

Back when we were doing the runtime split for 3.2 I did some testing on how having code in separate plugins vs. one plugin impacts performance.


Performance-wise having code in separate bundles had small impact on startup time. To be more concrete, having an extra bundle on WinXP 2GHz 2Gb adds about 1ms to the "warm" startup time. The impact is more significant for the "cold" startup, but those are very hard to quanitfy. My guess would be 2 - 5 ms, but it is just a guess (variability of cold startups is too high).


What did seem to impact startup performance was the amount of code that had to be loaded. More features -> more code -> slower startup. Again, to put some numbers, on the system above having a few extra classes loaded in activators added 28 ms to the startup sime.


There was no detectable impact on the runtime performance. Memory impact was rather hard to measure reliable; from the common sense there should be very little cost memory-wise. As for threads, there is no relationship between the number of threads and number of bundles.


In my opinion, granularity of bundles should be determined more by things like:

- business considerations;

- need to keeping things compartmentalized / reusable;

- separation of work between developers / teams.

>From a technical side there is a small cost associated with having extra bundles, but it seems to be rather small. That said please don't create a bundle per class :-)


Sincerely,

Oleg Besedin

Craig Setera <craigjunk-1Lq0CT30SxYdnm+yROfE0A@public.gmane.org>
Sent by: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

01/31/2007 08:00 AM

 

Please respond to
Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>

 

 

To

equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org

cc

 

Subject

[equinox-dev] Bundle Granularity?

 

 

 

 







I'm wondering if there are any rules of thumb in terms of the
granularity of bundles?  What are the advantages and disadvantages of
having fine grained bundles versus coarser grained bundles?  For
instance, what is the average cost of a bundle in terms of:

- Memory overhead?
- Classloader lookup times?
- Threads in the system?
- Other overhead?

The positive things I can think of include the ability for the system to
lazily load only the bundles that are actually necessary.  What are the
other advantages of finer grained bundles?

Thanks for any insights you can provide.
Craig

PS - I'm primarily talking about bundles in the context of the Eclipse
platform rather than at the Equinox framework level.
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Toni Menzel | 1 Feb 20:56
Picon
Picon
Gravatar

Re: Bundle Granularity?

i think the current packaging granularity has much to do with the mantra 
in eclipse "one bundle per project" or "one project per bundle" which 
forces larger bundles in a subtle way. (it's just a naming thing. and 
project is an old term with much impact baked into it from a semantic 
point of view)

some more notes on
1. this convinience issue is mostly driven by the fact that usual java 
packaging (jars) isn't really made to match with more advanced packaging 
methodologies (as osgi is).
It's by the way a reason why handling osgi bundles with a static and 
jar-driven maven is still pretty brittle (as peter kriens likes to say, too)
2+3: it's a difficult thing for equinox building/enforcing the next 
specification on one hand and give a top-class osgi R4 implementation to 
the community. this implementation should be exchangable to save the 
open source mantra i think. If I understand Tom's "hook into it" this 
isn't possible currently, is it?
Here we have a good example for the anti-forces "tight coupling" or 
"redundancy" ..

kind regards,
Toni

Rick Litton schrieb:
>
> Hi Tom,
>
> Please refer to my responses below.
>
> Rick Litton
>
> ------------------------------------------------------------------------
>
> *From:* equinox-dev-bounces@... 
> [mailto:equinox-dev-bounces@...] *On Behalf Of *Thomas Watson
> *Sent:* Thursday, February 01, 2007 10:09 AM
> *To:* Equinox development mailing list
> *Subject:* RE: [equinox-dev] Bundle Granularity?
>
>
> There are a few reasons we package the core org.osgi classes in the 
> framework implementation (org.eclipse.osgi)
>
> 1) Packaging convenience. Having all the org.osgi.* classes packaged 
> directly in the framework implementation reduces the amount jars you 
> need to find and place on the classpath of the framework.
> -> I was assuming that the osgi bundles will be auto-started and that 
> the required packages are exported which can then be imported by 
> org.eclipse.osgi. I haven’t actually done this but I think it should work.
> 2) Technically we need to modify some of the classes provided by the 
> OSGi Alliance to hook into our implementation. For example, 
> FrameworkUtil, AdminPermission and BundleSignerCondition.
>
> -> Can we get away with just extending the osgi interfaces? I guess I 
> find changing someone else’s framework classes/interfaces unappealing.
>
> 3) Working on future reference implementations for the OSGi Alliance. 
> We need the ability to modify the API with enhancements that will 
> become available in future public OSGi specifications. For example, we 
> are currently working on the Reference Implementation for OSGi R4.1 
> which introduces a small number new methods.
>
> -> Personally, I think that this is even an important consideration. 
> Switching OSGi R4 bundles with OSGi R4.1 ones will be a “snap” 
> (hopefully) when they become available. Like everyone else, I suppose 
> OSGi will also provide maintenance or versioned releases to fix 
> defects, etc. It would be expedient to simply switch to those 
> versioned ones without having to release an Equinox distro in 
> response. In this sense, tight coupling has its disadvantages in my view.
>
> Tom
>
>
>
> *"Rick Litton" <Rick.Litton@...>*
> Sent by: equinox-dev-bounces@...
>
> 02/01/2007 11:35 AM
>
> Please respond to
> Equinox development mailing list <equinox-dev@...>
>
> 	
>
> To
>
> 	
>
> "Equinox development mailing list" <equinox-dev@...>
>
> cc
>
> 	
>
> Subject
>
> 	
>
> RE: [equinox-dev] Bundle Granularity?
>
> 	
>
>
>
>
> Jeff McAffer wrote:
>
> > In Eclipse we have continually refactored bundles. In 3.2 the Runtime 
> bundle was split into 5 or 6 bundles. In 3.0 the UI was split into 7. 
> This was driven by actual usecases and requirements. It turns out that 
> one of the key factors in the simplicity/difficulty of doing that 
> refactoring was Java package naming! We got hosed a couple of times by 
> lumping fundamentally unrelated things together in the same Java 
> package. org.eclipse.core.runtme for example. When we went to refactor 
> we ended up needing to split the same package over multiple bundles. 
> This is possible but can be ugly and in the end results in some 
> unfortunate legacy naming glitches.
>
> On the subject of refactoring, perhaps you would consider removing the 
> org.osgi.* packages inside org.eclipse.osgi bundle and instead use the 
> core and compendium bundles from OSGi directly. Not sure if there is 
> any “legal” or technical impediment to this approach.
>
> Rick Litton
>
> ------------------------------------------------------------------------
>
>
> *From:* equinox-dev-bounces@... 
> [mailto:equinox-dev-bounces@...] *On Behalf Of *Jeff McAffer*
> Sent:* Wednesday, January 31, 2007 5:40 PM*
> To:* Equinox development mailing list*
> Subject:* Re: [equinox-dev] Bundle Granularity?
>
>
> My 2c
>
> I'm in agreement on bundling making sense from a 
> code/reuse/componentization point of view. We use a simple rule.
> "If two bundles will never be shipped separately, combine them"
> Your definition of "never" may change over time but that's ok. What 
> doesn't change? In Eclipse we have continually refactored bundles. In 
> 3.2 the Runtime bundle was split into 5 or 6 bundles. In 3.0 the UI 
> was split into 7. This was driven by actual usecases and requirements. 
> It turns out that one of the key factors in the simplicity/difficulty 
> of doing that refactoring was Java package naming! We got hosed a 
> couple of times by lumping fundamentally unrelated things together in 
> the same Java package. org.eclipse.core.runtme for example. When we 
> went to refactor we ended up needing to split the same package over 
> multiple bundles. This is possible but can be ugly and in the end 
> results in some unfortunate legacy naming glitches.
>
> Anyway, this is distinct from discussions of extensions vs services 
> etc. I actually disagree with Simon that this should impact what you 
> do. Yes there is one extension point definer but the extension point 
> definer is the moral equivalent the bundle that defines a service 
> *interface* not the instances of the service. These are the people who 
> define the contract. In OSGi typically there is only one of a given 
> service interface. There is no particular need to pair extension use 
> with Require-Bundle use. Extension points can be moved between bundles 
> as can service interface definitions so indeed it could be seen as a 
> programming/design error to depend on extension point origin.
>
> Jeff
>
> *Simon J Archer <sarcher@...>*
> Sent by: equinox-dev-bounces@...
>
> 01/31/2007 10:56 AM
>
> Please respond to
> Equinox development mailing list <equinox-dev@...>
>
> 	
>
> To
>
> 	
>
> Equinox development mailing list <equinox-dev@...>
>
> cc
>
> 	
>
> Equinox development mailing list <equinox-dev@...>, 
> equinox-dev-bounces@...
>
> Subject
>
> 	
>
> Re: [equinox-dev] Bundle Granularity?
>
>
> 	
>
>
>
>
>
>
> Craig
>
> I wanted to echo Oleg's points. Deciding whether to have one bundle or 
> two is a very similar decision to whether you should have one class or 
> two. The most important thing, in my opinion, is to model the problem 
> appropriately, rather than trying to create less bundles in the hope 
> of some performance gains. The reality is that fine grained bundles 
> are typically more flexible and more reusable than coarse grained 
> bundles, but they are also more complicated to understand.
>
> Something that I have observed is that people building bundles for the 
> Eclipse platform tend to build less fine grained bundles than people 
> building bundles for some other OSGi/Equinox application. One reason 
> for this, I believe, is Eclipse extension points: While an extension 
> point allows you to achieve similar things to an OSGi service, there 
> is only ever exactly one provider of a particular Eclipse extension 
> point, whereas there can be many providers of a particular OSGi 
> service. Eclipse bundles are typically not composed of OSGi services, 
> although that is not to say they cannot be used. Instead the Eclipse 
> platform tends to favor extension points. Reasons for this include 
> Eclipse's necessity for laziness, and another is Eclipse's origins and 
> life before OSGi.
>
> I tend to find that when I'm building bundles for Eclipse I use the 
> Require-Bundle manifest header to describe my bundle's dependency on a 
> particular bundle (that often declares an extension point to which I 
> wish contribute), whereas when I am building bundles for OSGi/Equinox 
> I use the Import-Package manifest header. Require-Bundle encourages 
> coarse grained dependencies, whereas Import-Package encourages fine 
> grained dependencies.
>
> I would suggest leaning towards fine grained bundles rather than 
> coarse, since merging bundles is far easier than splitting bundles.
>
> I hope this helps,
>
> Simon
>
> *Oleg Besedin <obesedin@...>*
> Sent by: equinox-dev-bounces@...
>
> 01/31/2007 10:20 AM
>
> Please respond to
> Equinox development mailing list <equinox-dev@...>
>
> 	
>
> To
>
> 	
>
> Equinox development mailing list <equinox-dev@...>
>
> cc
>
> 	
>
> Subject
>
> 	
>
> Re: [equinox-dev] Bundle Granularity?
>
>
> 	
>
>
>
>
>
>
>
> Hi Craig,
> Back when we were doing the runtime split for 3.2 I did some testing 
> on how having code in separate plugins vs. one plugin impacts 
> performance.
>
> Performance-wise having code in separate bundles had small impact on 
> startup time. To be more concrete, having an extra bundle on WinXP 
> 2GHz 2Gb adds about 1ms to the "warm" startup time. The impact is more 
> significant for the "cold" startup, but those are very hard to 
> quanitfy. My guess would be 2 - 5 ms, but it is just a guess 
> (variability of cold startups is too high).
>
> What did seem to impact startup performance was the amount of code 
> that had to be loaded. More features -> more code -> slower startup. 
> Again, to put some numbers, on the system above having a few extra 
> classes loaded in activators added 28 ms to the startup sime.
>
> There was no detectable impact on the runtime performance. Memory 
> impact was rather hard to measure reliable; from the common sense 
> there should be very little cost memory-wise. As for threads, there is 
> no relationship between the number of threads and number of bundles.
>
> In my opinion, granularity of bundles should be determined more by 
> things like:
> - business considerations;
> - need to keeping things compartmentalized / reusable;
> - separation of work between developers / teams.
>
> >From a technical side there is a small cost associated with having 
> extra bundles, but it seems to be rather small. That said please don't 
> create a bundle per class :-)
>
> Sincerely,
> Oleg Besedin
>
> *Craig Setera <craigjunk@...>*
> Sent by: equinox-dev-bounces@...
>
> 01/31/2007 08:00 AM
>
> Please respond to
> Equinox development mailing list <equinox-dev@...>
>
> 	
>
> To
>
> 	
>
> equinox-dev@...
>
> cc
>
> 	
>
> Subject
>
> 	
>
> [equinox-dev] Bundle Granularity?
>
> 	
>
>
>
>
>
>
>
> I'm wondering if there are any rules of thumb in terms of the
> granularity of bundles? What are the advantages and disadvantages of
> having fine grained bundles versus coarser grained bundles? For
> instance, what is the average cost of a bundle in terms of:
>
> - Memory overhead?
> - Classloader lookup times?
> - Threads in the system?
> - Other overhead?
>
> The positive things I can think of include the ability for the system to
> lazily load only the bundles that are actually necessary. What are the
> other advantages of finer grained bundles?
>
> Thanks for any insights you can provide.
> Craig
>
> PS - I'm primarily talking about bundles in the context of the Eclipse
> platform rather than at the Equinox framework level.
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev_______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>   

--

-- 
Toni Menzel
http://www.tonit.com
mailto:tonimenzel@...

Thomas Watson | 1 Feb 21:36
Picon
Favicon

RE: Bundle Granularity?


equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org wrote on 02/01/2007 01:22:27 PM:

> Hi Tom,
>  
> Please refer to my responses below.
>  
> Rick Litton

> There are a few reasons we package the core org.osgi classes in the
> framework implementation (org.eclipse.osgi)
>
> 1) Packaging convenience.  Having all the org.osgi.* classes
> packaged directly in the framework implementation reduces the amount
> jars you need to find and place on the classpath of the framework.
> -> I was assuming that the osgi bundles will be auto-started and
> that the required packages are exported which can then be imported
> by org.eclipse.osgi.  I haven’t actually done this but I think it should work.

The OSGi framework is not loaded with an OSGi classloader.  It has no
ability to reach out into a bundle to load classes via Import-Package.  
Especially core classes in the org.osgi.framework package that are needed
to implement the Framework itself.

> 2) Technically we need to modify some of the classes provided by the
> OSGi Alliance to hook into our implementation.  For example,
> FrameworkUtil, AdminPermission and BundleSignerCondition.
> -> Can we get away with just extending the osgi interfaces?  I guess
> I find changing someone else’s framework classes/interfaces unappealing.

The OSGi specification states that implementations are free to modify
the OSGi classes to hook in to their implementation.  We cannot
simply extend classes like FrameworkUtil because that is the class
that other bundles will reference, not our extending class.  That
would create a containerism.

Felix project is also packing the org.osgi packages in the felix
framework for the same reason.

>
> 3) Working on future reference implementations for the OSGi
> Alliance.  We need the ability to modify the API with enhancements
> that will become available in future public OSGi specifications.  
> For example, we are currently working on the Reference
> Implementation for OSGi R4.1 which introduces a small number new methods.
> -> Personally, I think that this is even an important consideration.
> Switching OSGi R4 bundles with OSGi R4.1 ones will be a “snap”
> (hopefully) when they become available.  Like everyone else, I
> suppose OSGi will also provide maintenance or versioned releases to
> fix defects, etc.  It would be expedient to simply switch to those
> versioned ones without having to release an Equinox distro in
> response.  In this sense, tight coupling has its disadvantages in my view.
>

We cannot treat these core classes as a real bundle, I can see some value
in having the jar separate from the org.eclipse.osgi jar but it adds
complication when launching the framework because you need to find an
osgi.jar that is compatible with the framework implementation.

Tom
Toni Menzel | 1 Feb 21:53
Picon
Picon
Gravatar

Re: Bundle Granularity?

About "We cannot treat these core classes as a real bundle":
Using an osgi framework to actually launch the one to be used at 
application-level is a way i think.
Looks like a chicken-egg problem but nevertheless looks cool in my point 
of view..
Toni

Thomas Watson schrieb:
>
> equinox-dev-bounces@... wrote on 02/01/2007 01:22:27 PM:
>
> > Hi Tom,
> >
> > Please refer to my responses below.
> >
> > Rick Litton
>
> > There are a few reasons we package the core org.osgi classes in the
> > framework implementation (org.eclipse.osgi)
> >
> > 1) Packaging convenience. Having all the org.osgi.* classes
> > packaged directly in the framework implementation reduces the amount
> > jars you need to find and place on the classpath of the framework.
> > -> I was assuming that the osgi bundles will be auto-started and
> > that the required packages are exported which can then be imported
> > by org.eclipse.osgi. I haven’t actually done this but I think it 
> should work.
>
> The OSGi framework is not loaded with an OSGi classloader. It has no
> ability to reach out into a bundle to load classes via Import-Package.
> Especially core classes in the org.osgi.framework package that are needed
> to implement the Framework itself.
>
> > 2) Technically we need to modify some of the classes provided by the
> > OSGi Alliance to hook into our implementation. For example,
> > FrameworkUtil, AdminPermission and BundleSignerCondition.
> > -> Can we get away with just extending the osgi interfaces? I guess
> > I find changing someone else’s framework classes/interfaces unappealing.
>
> The OSGi specification states that implementations are free to modify
> the OSGi classes to hook in to their implementation. We cannot
> simply extend classes like FrameworkUtil because that is the class
> that other bundles will reference, not our extending class. That
> would create a containerism.
>
> Felix project is also packing the org.osgi packages in the felix
> framework for the same reason.
>
> >
> > 3) Working on future reference implementations for the OSGi
> > Alliance. We need the ability to modify the API with enhancements
> > that will become available in future public OSGi specifications.
> > For example, we are currently working on the Reference
> > Implementation for OSGi R4.1 which introduces a small number new 
> methods.
> > -> Personally, I think that this is even an important consideration.
> > Switching OSGi R4 bundles with OSGi R4.1 ones will be a “snap”
> > (hopefully) when they become available. Like everyone else, I
> > suppose OSGi will also provide maintenance or versioned releases to
> > fix defects, etc. It would be expedient to simply switch to those
> > versioned ones without having to release an Equinox distro in
> > response. In this sense, tight coupling has its disadvantages in my 
> view.
> >
>
> We cannot treat these core classes as a real bundle, I can see some value
> in having the jar separate from the org.eclipse.osgi jar but it adds
> complication when launching the framework because you need to find an
> osgi.jar that is compatible with the framework implementation.
>
> Tom
> ------------------------------------------------------------------------
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@...
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>   

--

-- 
Toni Menzel
http://www.tonit.com
mailto:tonimenzel@...


Gmane