Re: Modularization - Packages, DLLs, COM - Which is best?
From: Ndi (Ndi_at_Ndi_dot_ro)
Date: 11/26/03
- Next message: Donald: "Re: Capture F5 Keystroke"
- Previous message: BruSoft: "Re: Capture F5 Keystroke"
- In reply to: Bill Gage: "Re: Modularization - Packages, DLLs, COM - Which is best?"
- Next in thread: Marc Scheuner: "Re: Modularization - Packages, DLLs, COM - Which is best?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 26 Nov 2003 05:32:11 +0200
> * BPLs - Will reduce the size of the application distribution.
Emmm ... The way BPL works towards application size increase is a
multi-exe to single or multiple BPLs, which is the exact opposite of the
addon concept. In an addon/plugin/whatever, the main code is usually in the
main file and addons just provide added functionality. In 99% of the cases,
they will be the same, minus the enhancements of the BPL (the steroids, as
Peter put it)
> * DLLs - Are able to be changed and not require other programs to be
> recompiled. However, DLLs more often than not will end up being larger
than
> a BPL, and they are more complicated when it comes to encorporating
Objects
> and Forms.
First, they are the same size, basically, give or take minor changes.
Secondly, there isn't any point to go and implement and implement and
implement if you build and addon. The best and addon should do is contain
the declaration of an object to pass it around and export a few entry points
allowing the master app to control it transparently.
If you need to heavily code an addon, maybe you should rethink the
architecture. The whole idea of an addon is to do nothing more than add
functionality. If it adds whole sections of a program, then the main exe
itself should support a flexible way of providing interfaces for the DLL to
handle those.
Even better, aside from BPLs, DLLs have a plus guarantee. The content will
never change, and they can be compiled by someone using a different platform
and a different language. A coder working on Linux that can compile for
Win32 can write a dll.
> * Plug Ins - I am not too familiar with this concept.
As I see it (and use it) this is a concept. What it means actually, is
that a main application or group of applications can provide additional
features by adding 3rd party code in a known format. Be it called a plugin,
addon, module, whatever, its job is to increase the functionalty of the
software you already have. It might mean you can buy filters for an audio
editor, codec for a player/encoder, features to a chat client, new functions
to a math application, it:
* frees the user form re-downloading a whole new version for each minor
plus
* allows other people to add functionality without opening your source
* allows partial upgrade/fix to a certain function (like oooops i forgot
to check if not zero)
* simplifies distribution of software by allowing the user to only buy
functions it needs instead of a rather expensive package
* makes the code easier to maintain. (If an error keeps popping up in GUI
after adding the DIV addon, it's in the addon, not the GUI)
* etc, etc
Adding on, as a concept, implements all of the above and more but
basically a user uses more of a feature than others. Usually, if it adds
functions (like a graphical filter) it's called a plug-in. Addons to my star
project are called add-ons because they provide non-typical functionality,
varying from security updates to file management helpers.
> To be able to break one giant program into smaller parts.
You can do tat with any of the options presented. You might need to be
more specific as to why.
> I don't need to reuse the parts with other programs.
In that case, a main BPL is useless. Also, in this case BPLs don't help
with size much since a central BPL contains common code so that new
applications don't need to re-implement those functions.
> I would like to be able to add new modules without having to recompile
> everything.
Then I'd go for the dlls. Personal opinion.
> I would also like to be able to change existing modules without having to
> recompile everything too.
Same. Dlls are more reliable to compiler updates. That is you might be
able to recompile your new module with D7 if the main app was written in D5
unless you pass around objects that have changed between versions. If you
pass memory structures made of basic elements (integes, pchars, etc), you'll
be quite safe. Plus, these have equivalents to just about any compiler out
there.
> It looks like I will still need to use binary patching, but I can live
with
> that.
Only for the main, larger parts. Modules are re-downloaded to newer
versions. An online upgrade feature goes great here.
> But it would be nice if the patches were much smaller, and more
> localized to the modules.
Patching the main exe is bound to be a pain. But if you keep the addons
down as per-module size, it will be a singe. Full update can be full auto
and can take less than a minute even over a modem. A quite comprehensive DLL
that does not embed VCL controls is below 100k, maybe around 50k.
> I am not leaning in any direction yet. No one or nothing of what I have
> read has brought up any major RED flags.
It shouldn't, as there is no correct route. All listed options take you
there. But the known route is the shortest route. I would personally go for
DLLs, but whatever you do it's fine. Small pluses and minuses are there, but
since I know DLL technology, I use it and didn't hit any limit yet.
If you are unfamiliar with DLLs, it might take you twice the time to
implement and debug DLLs than it would to write a BPL, that is if you are
familiar with BPLs.
IMO, do whatever feels good to you. I picked DLLs because of the more
flexible approach to simple interfacing. I prefer a more complex approach to
plugin handling so I can do a simpler addon architecture. There's nothing
like a 20K addon that adds network monitoring and filtering ability. Also,
all the docs are there, as opposed to what I consider to be the worst way, a
3rd party solution. I prefer to have it all in my .pas file.
-- Andrei "Ndi" Dobrin Brainbench MVP www.Brainbench.com
- Next message: Donald: "Re: Capture F5 Keystroke"
- Previous message: BruSoft: "Re: Capture F5 Keystroke"
- In reply to: Bill Gage: "Re: Modularization - Packages, DLLs, COM - Which is best?"
- Next in thread: Marc Scheuner: "Re: Modularization - Packages, DLLs, COM - Which is best?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|