- 29 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Dependency Injection
- Updated on 29 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Quantum Choice products use a dependency injection model to loosely couple Claim Editing System Integration components with Quantum Choice. This requires elements to be configured in the app.config file for the calling assembly to map the resolved component at runtime.
In the configSections element of the app.config, ensure the following section declaration is uncommented and exposed:
<configSections>
…
<section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
…
</configSections>
Within the configuration file, uncomment and expose the following components in the castle components section:
<castle>
<components>
<component id="ExternalClaimEditRequest"
service="Plexis.ClaimEditingSoftware.IExternalClaimEditRequest, Plexis.ClaimEditingSoftware"
type="Plexis.CES.C4H.C4HClaimEditRequest, Plexis.CES.C4H"
lifestyle="transient"/>
</components>
<components>
<component id="ExternalCredential"
service="Plexis.ClaimEditingSoftware.ICesCredential, Plexis.ClaimEditingSoftware"
type="{Implementation}, {Assembly}"
lifestyle="singleton"/>
</components>
</castle>
Replace the highlighted {Implementation} and {Assembly} tags with the client implementation of Plexis.ClaimEditingSoftware.ICesCredential.
See Authentication Credential Configuration for instructions regarding implementing the component.
For example:
Implementation = “assembly.class” = MyProject.MyImplementation.CES.MyCredential
Assembly = “DLL name (assembly name)” = MyProject.MyImplementation.CES
In the example above, MyProject.MyImplementation.CES is the name of the Visual Studio project. In the properties (application tab) of the project, you can define the Assembly name, but by default, it will use the name of the project you have created.
The project was built with a class called ‘MyCredential’ which implements the ICesCredential. This is the name that replaces the {Implementation} type above. Be sure to use the fully qualified name (Assembly.class name) and not just the class name by itself.