Version 1, last updated by markcopenhaver at December 18, 2010 00:00 UTC
DotNET Components
The EncounterPRO kernel and shell are written in PowerBuilder. Most of the components are also written in PowerBuilder but many components are written in C#. In order to plug in the C# components and manage their versions correctly, EncounterPRO uses a COM wrapper and late binding.
The specific COM wrapper class name depends on the component type. These relationships are stored in the c_Component_Type table. For example, the COM wrapper class for Document components is "EncounterPRO.OS.Component.DocumentWrapper". As of this writing, all of the COM wrappers are defined in the EncounterPRO.OS.Utilities assembly which is deployed with all of the EncounterPRO programs and can be found on the Source/SVN tab under Utilities.
After EncounterPRO instantiates the COM wrapper, it always calls the ConnectClass method on the COM wrapper. The ConnectClass will load the .Net assembly containing the desired component and instantiate the desired class within that assembly. After that, EncounterPRO can make calls to the appropriate methods through the COM wrapper.
In order to support the evolution and improvement of components, EncounterPRO keeps track of different versions of the same component. The administrator may use the component configuration screens to define new components, define new versions of existing components, and to select which version of each component should be used by EncounterPRO. This information is stored in the c_Component_Definition and c_Component_Version tables. The component_location and component_data columns in c_Component_Version store the assembly display name and the components class respectively. This information is passed to ConnectClass when the component is instantiated.
In order to keep the administrator from having to go around and install a new component version on every client computer, EncounterPRO also stores the component installer executable in c_Component_Version. Whenever EncounterPRO needs to call a component, it checks to see if the desired component version has already been installed on that computer. If not, then just before instantiating the component EncounterPRO will copy the component installer executable to a temp directory and run it using encrypted credentials stored in the database. If the system administrator has set up encrypted credentials with local admin access on all the client computers, then this just-in-time installation will save them time when new component versions are released.