Hello Mohammad,

On May 31, 2012, at 20:36 , Mohammad Nour El-Din wrote:

> But from what you said Frank, and what others proposed, I think you don't
> need that kind of modularity facilitated by OSGi or like technologies, I
> believe all what we need then is:
> 
> 1- Good design

+1

> 2- Good documentation about adding new modules/components

+1

> 3- Managing modules/components dependencies using maven for example

I actually don't agree that Maven is a good example of managing dependencies, 
for a couple of reasons:

1) It manages dependencies between components (jar files with multiple, often a 
lot of packages). This is often way too coarse grained, leading to transitive 
dependencies that tend to "drag in the whole universe".

2) It does not allow you to separate API from implementation in an easy way, 
meaning you end up depending on some specific implementation (of for example 
logging) instead of only depending on the API.

In stead, the OSGi model (regardless of whether you use OSGi or not) shares 
code at the package level, so you can for example depend on just an API 
package. Also, it allows you to distinguish between public/shared packages and 
private ones.

> 4- Good code organization to reflect this modularity on code level in the
> repo

Agreed. In practice though, you will find that if you have no means of 
enforcing modularity at runtime, it is hard to prevent people from doing things 
that conflict with your nice and modular design.

So if you're serious about creating a modular architecture, regardless of the 
fact that you don't need the dynamic updating at runtime, or even the 
versioning, I would still personally use the framework to simply enforce the 
good design at runtime. Or, turn it around, what other technology would you use?

Another thing to consider: there are no short term benefits of creating such a 
modular architecture, in fact it is extra work and it probably introduces some 
additional complexity now. In the long term though, it definitely has benefits, 
as modular applications tend to be more easy to maintain a couple of years from 
now.

Greetings, Marcel

Reply via email to