Hello, I am currently planning on using fo-dicom to implement a modern PACS. For keeping the design clean and modular I would prefer to use dependency injection.
When looking at any SCP examples, I see the static Create<T> method is used to create my DicomService, but this method does not (from what I can understand) provide a simple way to support additional constructor parameters.
For example:
Within the PACS I want to implement the DICOM Store Service.
The DICOM Store Service may depend on a database access service, a settings reader, an audit logging service, etc.
I would rather implement these dependencies as follows:
DicomStoreService : DicomService, IDicomServiceProvider, IDicomCEchoProvider
{
...
public DicomStoreService(INetworkStream stream, Encoding enc, Logger log, IMyInjectedService a, IMyOtherInjectedService b)
...
public void OnReceiveAssociationRequest(DicomAssociation association)
{
_a.DoSomething(); //Stored instance of IMyInjectedService
....
}
}
Is there a recommended way to achieve this in fo-dicom?
I originally thought of using property injection (after creation of the server) but I would rather stick to constructor injection if possible to prevent instantiation of my services without their dependencies.
Hopefully I've made this clear enough, thanks in advance!