I read many questions on StackOverlow about plugins in Delphi (like this one).
Anyway I still have a doubt and I would like to discuss my real case scenario.
i develop a huge application, just to give an idea it is a "fat client" client/server application, with 80MB of exe (big size is mainly due to many 3rd party components I use).
I have the requirement to modify this application too much, so i ended up with the idea of writing plugins, because once a "plugin foundation" is made i think i can add new features more quickly.
My initial idea was to write exes as plugins (i can pass from the main application a command line parameter to the plugin exe where i pass the connection string to the db - encrypted maybe).
But i realize this limits me too much. (and that an exe is not a "real plugin")
Let me try to express myself by a realworld example.
My applciation has many forms, most of them with a tabcontrol.
Let's take the Customers (think to CRM software) form.
This form has a main tab with main data (company name, address, main phone, main email address, ...), then there is a Contacts tab (list of contacts with their personal data), plus many other tabs specific to my application.
Let's say that I'd like to add a new tab from a plugin.
I make a silly example.
Plugin is ChristmasGIfts.dll (to manage comapny gifts i do to customers for Christmas)
This plugin should add a new tab with Caption "Xmas Gifts" in the Customers form.
The content of the tab will be a "frame/form" that allows the user to define which gifts should be sent to the customer for next XMas + see the history of last years.
So this "new tab" will have its own logic (a datamodule) and its own controls (a frame/form).
Moreover as i click on the "Save" button my main applcation must validate also the plugin data (for example "you must insert at least a XMas gift").
It is not clear to me how to lay down this architecture.
Somehow my question is:
1) how to extract a frame/form from a dll to add it at runtime to my form?
2) how to delegate the dll to do data validation and return a message
I hope you can help.