The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Modular Applications

Just curious if anyone here has developed truly "modular" applications. That is, applications where significant new functionality can be added by just dropping in another library (or whatever) into your build files and the design of your application is smart enough to pick up on this, add the functionality seamlessly and run with truly minimal code changes necessary. Anyone care to share how they do it, what methods they use, why they do it, etc.

It occurs to me that our main product could benefit significantly from something like this, as it has well defined modules, but right now adding and subtracting them is a pain since they tend to be more tightly integrated than necessary. (We're in the business of customizing this product for our customers).

A. Gorilla
Wednesday, January 11, 2006

I have done it several times

In my implementations, no code changes or rebuilds are required, at all.

My approach is to put each module in a DLL.  Each of these DLL modules implement all or part of a defined set of APIs. The main app loads all the DLLs and when it wants to do something which is part of the modular functionality calls one or more, or all, the DLLs.

It is not so hard, but it is not so easy.

It is not a panacea either, because their are nearly usually things you later wish had been part of the modular functionality, but you made part of the main app.

Some other things to think about:

- What about common functions found in all/most DLLs? Do you duplicate these in each DLL, or provide a library/call-back supporting all the DLLs?

- Do you all third parties/users the information to extend your app?

- What about backward compatibility between various versions of the App and DLL versionss?
S. Tanna
Wednesday, January 11, 2006
Ever heard of LoadLibrary?

The app detects and incorporates the DLLs at runtime
S. Tanna
Wednesday, January 11, 2006
Ways to detect a DLL at runtime:

1) A text configuration file in a known spot lists the DLLs.

2) A separate "plugins" directory (this is the approach Netscape takes). Every DLL in this directory is loaded.

3) COM Component Category. This requires your modules to be COM objects; if you're on Win32 and using unmanaged code, this is probably a good thing.

You'll need to provide:

A) A way for the hosting application to tell the modules to do something.

B) A way for the modules to tell the hosting application to do something.

C) A way for modules to tell each other to do something.

Figure these out (in .NET it's actually quite easy) and you're good to go.
Chris Tavares Send private email
Wednesday, January 11, 2006
COM and its interface-based programming approach is very well suited to modular architectures, and we've used it with great success in two medium-large projects ($8M and $4M budgets). We used a plug-in framework where the core "glue" exe looked up which modules to use in a configuration database (although you could use a basic text file too, just don't bother with Windows' Component Services which is too complicated and buggy). The core then instantiates each of the modules, then initializes each module by giving it pointers to all the other module interfaces it needs.

We had great side benefits to our highly modular approach, the big one being as the code base and complexity grew with subsequent customers who each wanted their customizations, only certain modules needed to be touched. Also as they say "any problem can be solved with another layer of abstraction" and inserting another module in between caller and callee allows you to do that. We could also spin modules off as they grew, into completely new apps and separate tools by stubbing out or building simple versions of the modules they depended on.

The key though is interface-based programming and plug-in architectures. COM is especially good at that, but you could use regular C++ polymorphism as well.
Thursday, January 12, 2006
Here's the deal: NOTHING in software development or design is easy or constitutes a "quick" deploy but I will say this: .NET makes it VERY easy to accomplish your objective when you work with new CLASS implementations.

For example, let's say you have an existing app that was developed with VB.Net. Suppose you decide that you want to "quickly" add text-to-speech capabilities or add an audio capability to the app.

All you would need to do is to add a CLASS library of functional methods, properties etc to your app (the internet has a zillion class libraries of functionality already developed for such purposes) and directly program against them.

Not terribly difficult to do provided you know in what context you want to use the newly added functionality.
Brice Richard Send private email
Friday, January 20, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz