What is the best way to write modular program?


   I have MDIForm project but that project's file size is getting larger and larger and it takes more time on the client side to run the program.   I want to create delphi packages to modularize project but i have alot of components that i am using in the project.(Like fast report, developer express components, TMS Software, Raize Components, SDAC Components etc.)  When i check the 'Build with runtime packages' option there are a lof of packages that i need to distribute with the program.  What is the best way to modularize the program according to above scenario.
    Thanks in advance.
Who is Participating?
Ioannis AnifantakisConnect With a Mentor Software EngineerCommented:
You cannot avoid the design time packages, as long as you decide to build with design time packages, and you use lots of components.

I myself, use almost the same components as you described in my applications.

So you can do one of the following:
1) Don't build with runtime packages
2) Build with runtime packages and have lots of packages to follow your exe.
3) Cut your code in sub-projects.

More specifically for (3) you can cut down some of your forms in DLLs.
More about "creating forms in DLLs for delphi" or generally "delphi and dlls" here:

Or even better create plugin forms or plugin panels.

To create plugin panels and forms is the best way for me and I use a very usefull middleware called "Hydra" from RemObjects.

With Hydra you can assign your main app to be the "host" application and then build visual and nonvisual plugins as subprojects.  The amazing with hydra is that you can build these plugins either in Delphi or in VisualStudio and attach these visual/nonvisual plugins to your main application.

That way you will cut down your code in easily managed sub-projects while at the same time you will open a window to your application to accept 3rd party plugins build in C# or VisualBasic.

To find more about hydra go here:
Geert GConnect With a Mentor Oracle dbaCommented:
here is a site from Colibri
it even shows how to use the design patterns


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.