Hi
I just started read Dependency Injection and try to start using Spring4D with Delphi Berlin.
I normally use Delphi 2007 so Spring4D is new for me.
I just wonder how it is supposed to setup.
First I try to add the Spring4D folders in the projects search path.
The path end up like this
C:\Spring4D\Source\Core\Container;C:\Spring4D\Source\Core\Logging;C:\Spring4D\Source\Base\Logging;C:\Spring4D\Source\Core\Services;C:\Spring4D\Source\Core\Interception
I got the error
[dcc32 Error] ContainerDemo.dpr(22): E2003 Undeclared identifier: 'GlobalContainer'
Then I added following lines to dpr-file
Spring.Container in 'C:\Spring4D\Source\Core\Container\Spring.Container.pas',
Spring.Services in 'C:\Spring4D\Source\Core\Services\Spring.Services.pas';
and it compile at least but with 3 hints and 2 warnings.
[dcc32 Warning] uNoServiceLocatorDemo.pas(23): W1000 Symbol 'InjectAttribute' is deprecated: 'Use Spring.Container.Common.InjectAttribute'
[dcc32 Warning] uContainerStuff.pas(46): W1000 Symbol 'InjectAttribute' is deprecated: 'Use Spring.Container.Common.InjectAttribute'
[dcc32 Hint] uContainerStuff.pas(40): H2219 Private symbol 'FHasScope' declared but never used
[dcc32 Hint] ContainerDemo.dpr(16): H2164 Variable 'TempBattlefield' is declared but never used in 'ContainerDemo'
[dcc32 Hint] ContainerDemo.dpr(17): H2164 Variable 'RifleIntf' is declared but never used in 'ContainerDemo'
When try the demo I got this
Project ContainerDemo.exe raised exception class EResolveException with message 'Cannot resolve type: TRifle'.
Obviously I doing something wrong. Can someone give me a hint ?
Regards
Roland Bengtsson