David,

Benefits
--------
1. You can load packages dynamically or statically.
2. You can put functions in packages and use then with the same functions
(GetProcAddress) you would use for DLL's
3. You can share forms between packages as though they existed in the same
executable
4. Delphi manages the memory for you (as far as I know)
5. You can put forms in a package and imbed them in the main form in your
EXE (even using MDI)
6. You can dynamically access your forms even from packages using GetClass
functions and RTTI
7. Packages are fancy DLL's

Drawbacks
---------
1. Do not use packages if you need people to develop plugins in other
languages other than Delphi
2. Packages are version specific in Delphi - a DCP from D4 can not be used
in D6
3. You must be very careful about your design (hierarchy of your packages)
4. A unit can not be compiled into two packages used by the same executable
5. ComServ can not be used in packages (caused me a problem with registering
for COM events)

Trust me, it is a VERY powerful mechanism and one I am exploiting to the
utmost, and currently developing a second extensible application at the
moment. 

Regards,
Darren

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of David Duffy
Sent: 28 March 2006 13:19
To: Borland's Delphi Discussion List
Subject: Re: Modular Program

I just tried the packages way and that seems to work but...

Do you have to hard code every package name that you want to use into the
main project? I'd like to be able to just drop files into the exe directory
and have the extra modules available the next time it runs.

Would DLL's be a better way to go for this functionality?
One reason for looking at your packages method was to be able to use an MDI
style interface like I've already used previously.

DLL's seem to rule that out. Or do they?

Darren McBride wrote:
> David,
>
> I've done exactly what you need using Delphi packages (and it 
> encompasses the modules you mentioned). Your biggest question at this 
> point is Delphi.NET or Win32. This will dictate whether you adopt the 
> standard Delphi package approach or the .NET assembly approach. Both will
do what you need.
>
> Regards,
> Darren
>
> -----Original Message-----
> Subject: Modular Program
>
> Hi,
> I'm thinking of writing a new application to use in my business that 
> would encompass accounting, ordering, inventory, sales, etc.
>
> The last one I wrote was all one exe file but I've been thinking of 
> something that had modules that could be added or updated or even 
> removed at some time after the original compilation.
>
> Does anyone have any pointers on how programs like Mozilla Firefox and 
> Thunderbird use extensions as this may be one way of achieving what I 
> want to do. Am I on the right track even?
>   


--
___________________________________________
David Duffy        Audio Visual Devices P/L
Unit 8, 10 Hook St, Capalaba 4157 Australia
Ph: +61 7 38235717   Fax: +61 7 38234717
New Web: www.audiovisualdevices.com.au
___________________________________________

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi




_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to