delphipackageglobal-variablesglobal-scope

How to get access to an object between dynamically loaded packages?


I need to know the user name and other data of the logged-in user in a project organized using BPLs. That is, how and where do I need to declare the user object and its creation, and how to get access to that object when a package is loaded at runtime? I don't have enough experience working with packages.


Solution

  • In a regular app, for the programmer there is no difference between using runtime packages or all in a single exe You can change the project to go with runtime packages or not, and your code won't change at all

    That changes when you make a modular app that loads BPL modules on demand, chosing at runtime if a given module will be load, and doing it dynamically (ex. app made with a plugin-architecture in mind), then you need to design your own strategy to handle that

    Myself, I work in that second way, and I do have some main modules wich give services to the "plugins", so when they are loaded, they do register themselves with the system: user control, navigation, whatever