This is the first post of four posts about modular applications.
I’ll try to explain all the things we must think of when we develop a modular application. I’m developing a generic core for modular applications, JTheque. So what I’m saying in this posts are taken from my experience developing this framework.
In this post, i’ll start talking of the bases of the conception of modular application. So what’s a modular application, a module and what give to the developer and the user to have a modular application ? In the next posts, I’ll describe the problems we could found relating to modules and loading. The examples will be in Java, but all the concepts can be applied to every language. I’ll not talk about OSGi, this is more an introduction to modular programming without specific framework, but of course, OSGi is a very good solution to modular programming.
Of course, I don’t think i’m a professional in modular programming and what I’ll say in this post, is nothing else than my point of view. If you think there is better solutions than what I present, don’t hesitate to say that in comments.
To start, what’s a modular application ? A modular application is made of 2 distinct parts :
The core : Like its name says, this is the central part of the application. This part must be completely independent of the modules.
The modules : It’s the dynamic parts we’ll add to the application to add features. There is other name for modules : add-ons, plugins and lot of other name, but the concept is the same.
I think there is two types of modular applications. The first type is a normal application who provide several features and give the user the possibility to add functionalities with modules. The second type is an application who has a core without feature. All the features are provided by the modules, so, “All is module”.
The main difference is that the first type can be used like any other application without modules, but the second one is not useful without modules.
In these two types of applications, you’ve to define some extension points for the modules. With that extension points, the modules can add features to the application or modify some features.
JTheque is based on the second type. JTheque Core is a simple core to develop modular applications. We can also talk of Eclipse that is a fully modular framework.
Now the question is : that seems good but what the hell does that offer ? First, from the point of view of a developer, this allows to clearly separate the different parts of its application. We’ve distinct modules easier to maintain than a big applications. It’s also easy to add features to applications. And last but not least, you can use the core several times for building different applications. From the point of view of the user, he can choose which modules he want to launch, add new modules and perhaps create some modules if he can. So he can customize applications.
But, that not trivial to make, you’ve to make a good conceptions and implement it in a clean way. When you do, you find some problmens to solve and a lot of questions to ask. We’ll see all the problems and questions in the next post.