我正在为Delphi评估现有的依赖注入库,并且由于它的简单性而在
delphidicontainer上定居 – 它只需要一个
unit file!
但是,有一件事我不明白 – 在this example file底部:
initialization //with those lines the linked will include the actual code for the services TCSVDataService.Register; TPaddedDataService.Register;
这些Register方法是空的,但是,如果我在初始化部分注释掉这两行,DIContainer.Get(‘dataservice’)将作为TDataService失败.
为什么?这些空方法是什么?