Nick Hodges avatar Nick Hodges committed 6c9c6a6

Updates for better presentation

Comments (0)

Files changed (46)

Demo.VirtualInterceptor.dproj

 	<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 		<PropertyGroup>
 			<ProjectGuid>{9885C86E-0F62-4E9C-A149-F222963CC66F}</ProjectGuid>
-			<ProjectVersion>12.3</ProjectVersion>
+			<ProjectVersion>13.4</ProjectVersion>
 			<MainSource>Demo.VirtualInterceptor.dpr</MainSource>
 			<Config Condition="'$(Config)'==''">Debug</Config>
 			<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
 			<Base>True</Base>
-			<Platform>Win32</Platform>
 			<AppType>Console</AppType>
 			<FrameworkType>None</FrameworkType>
+			<Platform Condition="'$(Platform)'==''">Win32</Platform>
+			<TargetedPlatforms>1</TargetedPlatforms>
 		</PropertyGroup>
 		<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
 			<Base>true</Base>
 		</PropertyGroup>
+		<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+			<Base_Win32>true</Base_Win32>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
 		<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
 			<Cfg_1>true</Cfg_1>
 			<CfgParent>Base</CfgParent>
 			<Base>true</Base>
 		</PropertyGroup>
 		<PropertyGroup Condition="'$(Base)'!=''">
+			<VerInfo_Locale>1033</VerInfo_Locale>
+			<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+			<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
 			<DCC_DependencyCheckOutputName>Project2.exe</DCC_DependencyCheckOutputName>
 			<DCC_ImageBase>00400000</DCC_ImageBase>
-			<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
 			<DCC_Platform>x86</DCC_Platform>
 			<DCC_E>false</DCC_E>
 			<DCC_N>false</DCC_N>
 			<DCC_F>false</DCC_F>
 			<DCC_K>false</DCC_K>
 		</PropertyGroup>
+		<PropertyGroup Condition="'$(Base_Win32)'!=''">
+			<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+			<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+			<VerInfo_Locale>1033</VerInfo_Locale>
+		</PropertyGroup>
 		<PropertyGroup Condition="'$(Cfg_1)'!=''">
 			<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
 			<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
 			<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
 		</PropertyGroup>
 		<ItemGroup>
-			<DelphiCompile Include="Demo.VirtualInterceptor.dpr">
+			<DelphiCompile Include="$(MainSource)">
 				<MainSource>MainSource</MainSource>
 			</DelphiCompile>
 			<BuildConfiguration Include="Debug">
 					</VersionInfoKeys>
 				</Delphi.Personality>
 				<Platforms>
+					<Platform value="Win64">False</Platform>
+					<Platform value="OSX32">False</Platform>
 					<Platform value="Win32">True</Platform>
 				</Platforms>
 			</BorlandProject>
Add a comment to this file

Demo.VirtualInterceptor.otares

Binary file added.

Add a comment to this file

Demo.VirtualInterceptor.res

Binary file modified.

DependencyInjection/Intro/6-UseContainer/Test/TestuOrderEntry.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Services
+    , Spring.Container
     ;
 
 procedure TestTOrderEntry.SetUp;
 begin
-  ServiceLocator.Build;
-  FOrderEntry := ServiceLocator.Resolve<IOrderEntry>;
+  GlobalContainer.Build;
+  FOrderEntry := ServiceLocator.GetService<IOrderEntry>;
 end;
 
 procedure TestTOrderEntry.TearDown;

DependencyInjection/Intro/6-UseContainer/Test/TestuOrderProcessor.pas

 implementation
 
 uses
-  uOrderMocks,
-  uOrderProcessor,
-  uServiceLocator;
+    uOrderMocks
+  , uOrderProcessor
+  , Spring.Container
+  , Spring.Services
+  ;
 
 procedure TestTOrderProcessor.TestProcessOrder;
 var
   aOrder: TOrder;
 begin
-  ServiceLocator.Build;
+  GlobalContainer.Build;
   // TODO: Setup method call parameters
-  FOrderProcessor := TOrderProcessor.Create(ServiceLocator.Resolve<IOrderValidator>, ServiceLocator.Resolve<IOrderEntry>);
+  FOrderProcessor := TOrderProcessor.Create(ServiceLocator.GetService<IOrderValidator>, ServiceLocator.GetService<IOrderEntry>);
   aOrder := TOrder.Create;
   try
     Check(FOrderProcessor.ProcessOrder(aOrder));

DependencyInjection/Intro/6-UseContainer/Test/TestuOrderValidator.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Services
+    , Spring.Container
     ;
 
 procedure TestTOrderValidator.SetUp;
 begin
-  ServiceLocator.Build;
-  FOrderValidator := ServiceLocator.Resolve<IOrderValidator>;
+  GlobalContainer.Build;
+  FOrderValidator := ServiceLocator.GetService<IOrderValidator>;
 end;
 
 procedure TestTOrderValidator.TearDown;

DependencyInjection/Intro/6-UseContainer/Test/UseContainerTests.dpr

   uOrderMocks in 'uOrderMocks.pas',
   TestuOrderProcessor in 'TestuOrderProcessor.pas',
   uOrderProcessor in '..\uOrderProcessor.pas',
-  uOrderInterfaces in '..\uOrderInterfaces.pas',
-  uServiceLocator in '..\uServiceLocator.pas';
+  uOrderInterfaces in '..\uOrderInterfaces.pas';
 
 {R *.RES}
 

DependencyInjection/Intro/6-UseContainer/Test/UseContainerTests.dproj

 			<DCCReference Include="TestuOrderProcessor.pas"/>
 			<DCCReference Include="..\uOrderProcessor.pas"/>
 			<DCCReference Include="..\uOrderInterfaces.pas"/>
-			<DCCReference Include="..\uServiceLocator.pas"/>
 			<BuildConfiguration Include="Release">
 				<Key>Cfg_2</Key>
 				<CfgParent>Base</CfgParent>

DependencyInjection/Intro/6-UseContainer/Test/uOrderMocks.pas

 implementation
 
 uses
-      uServiceLocator
-    , uOrder
+      uOrder
     , uOrderInterfaces
+    , Spring.Container
     ;
 
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TMockOrderEntry>.Implements<IOrderEntry>;
-  ServiceLocator.RegisterComponent<TMockOrderValidator>.Implements<IOrderValidator>;
+  GlobalContainer.RegisterComponent<TMockOrderEntry>.Implements<IOrderEntry>;
+  GlobalContainer.RegisterComponent<TMockOrderValidator>.Implements<IOrderValidator>;
 
 end.

DependencyInjection/Intro/6-UseContainer/UseContainer.dpr

   uOrderEntry in 'uOrderEntry.pas',
   uOrderInterfaces in 'uOrderInterfaces.pas',
   uOrderProcessor in 'uOrderProcessor.pas',
-  uOrderValidator in 'uOrderValidator.pas',
-  uServiceLocator in 'uServiceLocator.pas';
+  uOrderValidator in 'uOrderValidator.pas';
 
 begin
   try

DependencyInjection/Intro/6-UseContainer/UseContainer.dproj

 			<DCCReference Include="uOrderInterfaces.pas"/>
 			<DCCReference Include="uOrderProcessor.pas"/>
 			<DCCReference Include="uOrderValidator.pas"/>
-			<DCCReference Include="uServiceLocator.pas"/>
 			<BuildConfiguration Include="Release">
 				<Key>Cfg_2</Key>
 				<CfgParent>Base</CfgParent>

DependencyInjection/Intro/6-UseContainer/uDoOrderProcessing.pas

 
 uses
         uOrder
-      , uServiceLocator
+      , Spring.Services
+      , Spring.Container
       , uOrderInterfaces
    //   , uOrderValidator
    //   , uOrderEntry
 var
   Order: TOrder;
   OrderProcessor: IOrderProcessor;
+
+  OrderValidator: IOrderValidator;
+  OrderEntry: IOrderEntry;
 begin
-  ServiceLocator.Build;
+  GlobalContainer.Build;
   Order := TOrder.Create;
   try
-    OrderProcessor := TOrderProcessor.Create(ServiceLocator.Resolve<IOrderValidator>,
-                                             ServiceLocator.Resolve<IOrderEntry>);
+    OrderValidator := ServiceLocator.GetService<IOrderValidator>;
+    OrderEntry := ServiceLocator.GetService<IOrderEntry>;
+    OrderProcessor := TOrderProcessor.Create(OrderValidator, OrderEntry);
     if OrderProcessor.ProcessOrder(Order) then
     begin
       WriteLn('Order successfully processed....');

DependencyInjection/Intro/6-UseContainer/uOrderEntry.pas

 implementation
 
 uses
-    uOrder, uOrderInterfaces, uServiceLocator;
+       uOrder
+     , uOrderInterfaces
+     , Spring.Container
+     ;
 
 type
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderEntry>.Implements<IOrderEntry>;
+  GlobalContainer.RegisterComponent<TOrderEntry>.Implements<IOrderEntry>;
 
 end.

DependencyInjection/Intro/6-UseContainer/uOrderValidator.pas

 uses
      uOrder
    , uOrderInterfaces
-   , uServiceLocator;
+   , Spring.Container
+   ;
 
 type
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderValidator>.Implements<IOrderValidator>;
+  GlobalContainer.RegisterComponent<TOrderValidator>.Implements<IOrderValidator>;
 
 
 end.

DependencyInjection/Intro/7-CustomConstructor/CustomConstructor.dpr

   uOrderEntry in 'uOrderEntry.pas',
   uOrderInterfaces in 'uOrderInterfaces.pas',
   uOrderProcessor in 'uOrderProcessor.pas',
-  uOrderValidator in 'uOrderValidator.pas',
-  uServiceLocator in 'uServiceLocator.pas';
+  uOrderValidator in 'uOrderValidator.pas';
 
 begin
   try

DependencyInjection/Intro/7-CustomConstructor/CustomConstructor.dproj

 			<DCCReference Include="uOrderInterfaces.pas"/>
 			<DCCReference Include="uOrderProcessor.pas"/>
 			<DCCReference Include="uOrderValidator.pas"/>
-			<DCCReference Include="uServiceLocator.pas"/>
 			<BuildConfiguration Include="Release">
 				<Key>Cfg_2</Key>
 				<CfgParent>Base</CfgParent>

DependencyInjection/Intro/7-CustomConstructor/Test/CustomConstructorTests.dpr

   uOrderMocks in 'uOrderMocks.pas',
   TestuOrderProcessor in 'TestuOrderProcessor.pas',
   uOrderProcessor in '..\uOrderProcessor.pas',
-  uOrderInterfaces in '..\uOrderInterfaces.pas',
-  uServiceLocator in '..\uServiceLocator.pas';
+  uOrderInterfaces in '..\uOrderInterfaces.pas';
 
 {R *.RES}
 

DependencyInjection/Intro/7-CustomConstructor/Test/CustomConstructorTests.dproj

 			<DCCReference Include="TestuOrderProcessor.pas"/>
 			<DCCReference Include="..\uOrderProcessor.pas"/>
 			<DCCReference Include="..\uOrderInterfaces.pas"/>
-			<DCCReference Include="..\uServiceLocator.pas"/>
 			<BuildConfiguration Include="Release">
 				<Key>Cfg_2</Key>
 				<CfgParent>Base</CfgParent>

DependencyInjection/Intro/7-CustomConstructor/Test/TestuOrderEntry.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Container
+    , Spring.Services
     ;
 
 procedure TestTOrderEntry.SetUp;
 begin
-  ServiceLocator.Build;
-  FOrderEntry := ServiceLocator.Resolve<IOrderEntry>;
+  GlobalContainer.Build;
+  FOrderEntry := ServiceLocator.GetService<IOrderEntry>;
 end;
 
 procedure TestTOrderEntry.TearDown;

DependencyInjection/Intro/7-CustomConstructor/Test/TestuOrderProcessor.pas

 implementation
 
 uses
-  uOrderMocks,
-  uOrderProcessor,
-  uServiceLocator;
+    uOrderMocks
+  , uOrderProcessor
+  , Spring.Container
+  , Spring.Services
+  ;
 
 procedure TestTOrderProcessor.TestProcessOrder;
 var
   aOrder: TOrder;
 begin
-  ServiceLocator.Build;
+  GlobalContainer.Build;
   // TODO: Setup method call parameters
-  FOrderProcessor := ServiceLocator.Resolve<IOrderProcessor>;//TOrderProcessor.Create;//(ServiceLocator.Resolve<IOrderValidator>, ServiceLocator.Resolve<IOrderEntry>);
+  FOrderProcessor := ServiceLocator.GetService<IOrderProcessor>;//TOrderProcessor.Create;//(ServiceLocator.Resolve<IOrderValidator>, ServiceLocator.Resolve<IOrderEntry>);
   aOrder := TOrder.Create;
   try
     Check(FOrderProcessor.ProcessOrder(aOrder));

DependencyInjection/Intro/7-CustomConstructor/Test/TestuOrderValidator.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Container
+    , Spring.Services
     ;
 
 procedure TestTOrderValidator.SetUp;
 begin
-  ServiceLocator.Build;
-  FOrderValidator := ServiceLocator.Resolve<IOrderValidator>;
+  GlobalContainer.Build;
+  FOrderValidator := ServiceLocator.GetService<IOrderValidator>;
 end;
 
 procedure TestTOrderValidator.TearDown;

DependencyInjection/Intro/7-CustomConstructor/Test/uOrderMocks.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Container
     , uOrder
     , uOrderInterfaces
     ;
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TMockOrderEntry>.Implements<IOrderEntry>;
-  ServiceLocator.RegisterComponent<TMockOrderValidator>.Implements<IOrderValidator>;
+  GlobalContainer.RegisterComponent<TMockOrderEntry>.Implements<IOrderEntry>;
+  GlobalContainer.RegisterComponent<TMockOrderValidator>.Implements<IOrderValidator>;
 
 end.

DependencyInjection/Intro/7-CustomConstructor/uDoOrderProcessing.pas

 
 uses
         uOrder
-      , uServiceLocator
       , uOrderInterfaces
    //   , uOrderValidator
    //   , uOrderEntry
     //  , uOrderProcessor
+      , Spring.Services
+      , Spring.Container
       ;
 
 procedure DoOrderProcessing;
   Order: TOrder;
   OrderProcessor: IOrderProcessor;
 begin
-  ServiceLocator.Build;
+  GlobalContainer.Build;
   Order := TOrder.Create;
   try
-    OrderProcessor := ServiceLocator.Resolve<IOrderProcessor>;
+    OrderProcessor := ServiceLocator.GetService<IOrderProcessor>;
     if OrderProcessor.ProcessOrder(Order) then
     begin
       WriteLn('Order successfully processed....');

DependencyInjection/Intro/7-CustomConstructor/uOrderEntry.pas

 implementation
 
 uses
-    uOrder, uOrderInterfaces, uServiceLocator;
+      uOrder
+    , uOrderInterfaces
+    , Spring.Container
+    ;
 
 type
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderEntry>.Implements<IOrderEntry>;
+  GlobalContainer.RegisterComponent<TOrderEntry>.Implements<IOrderEntry>;
 
 end.

DependencyInjection/Intro/7-CustomConstructor/uOrderProcessor.pas

 implementation
 
 uses
-     uOrder, uOrderInterfaces, uServiceLocator;
+       uOrder
+     , uOrderInterfaces
+     , Spring.Container
+     , Spring.Services
+     ;
 
 type
   TOrderProcessor = class(TInterfacedObject, IOrderProcessor)
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderProcessor>.Implements<IOrderProcessor>.DelegateTo(
+  GlobalContainer.RegisterComponent<TOrderProcessor>.Implements<IOrderProcessor>.DelegateTo(
     function: TOrderProcessor
     begin
-      Result := TOrderProcessor.Create(ServiceLocator.Resolve<IOrderValidator>, ServiceLocator.Resolve<IOrderEntry>, 99);
+      Result := TOrderProcessor.Create(ServiceLocator.GetService<IOrderValidator>, ServiceLocator.GetService<IOrderEntry>, 99);
     end
   );
 

DependencyInjection/Intro/7-CustomConstructor/uOrderValidator.pas

 uses
      uOrder
    , uOrderInterfaces
-   , uServiceLocator;
+   , Spring.Container
+   ;
 
 type
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderValidator>.Implements<IOrderValidator>;
+  GlobalContainer.RegisterComponent<TOrderValidator>.Implements<IOrderValidator>;
 
 end.

DependencyInjection/Intro/8-FieldInjection/FieldInjection.dpr

   uOrderEntry in 'uOrderEntry.pas',
   uOrderInterfaces in 'uOrderInterfaces.pas',
   uOrderProcessor in 'uOrderProcessor.pas',
-  uOrderValidator in 'uOrderValidator.pas',
-  uServiceLocator in 'uServiceLocator.pas';
+  uOrderValidator in 'uOrderValidator.pas';
 
 begin
   try
     DoOrderProcessing;
-    ReadLn;
   except
     on E: Exception do
       Writeln(E.ClassName, ': ', E.Message);
   end;
+  ReadLn;
 end.

DependencyInjection/Intro/8-FieldInjection/FieldInjection.dproj

 			<DCCReference Include="uOrderInterfaces.pas"/>
 			<DCCReference Include="uOrderProcessor.pas"/>
 			<DCCReference Include="uOrderValidator.pas"/>
-			<DCCReference Include="uServiceLocator.pas"/>
 			<BuildConfiguration Include="Release">
 				<Key>Cfg_2</Key>
 				<CfgParent>Base</CfgParent>

DependencyInjection/Intro/8-FieldInjection/Test/FieldInjectionTests.dpr

   uOrderMocks in 'uOrderMocks.pas',
   TestuOrderProcessor in 'TestuOrderProcessor.pas',
   uOrderProcessor in '..\uOrderProcessor.pas',
-  uOrderInterfaces in '..\uOrderInterfaces.pas',
-  uServiceLocator in '..\uServiceLocator.pas';
+  uOrderInterfaces in '..\uOrderInterfaces.pas';
 
 {R *.RES}
 

DependencyInjection/Intro/8-FieldInjection/Test/FieldInjectionTests.dproj

 			<DCCReference Include="TestuOrderProcessor.pas"/>
 			<DCCReference Include="..\uOrderProcessor.pas"/>
 			<DCCReference Include="..\uOrderInterfaces.pas"/>
-			<DCCReference Include="..\uServiceLocator.pas"/>
 			<BuildConfiguration Include="Release">
 				<Key>Cfg_2</Key>
 				<CfgParent>Base</CfgParent>

DependencyInjection/Intro/8-FieldInjection/Test/TestuOrderEntry.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Services
+    , Spring.Container
     ;
 
 procedure TestTOrderEntry.SetUp;
 begin
-  ServiceLocator.Build;
-  FOrderEntry := ServiceLocator.Resolve<IOrderEntry>;
+  GlobalContainer.Build;
+  FOrderEntry := ServiceLocator.GetService<IOrderEntry>;
 end;
 
 procedure TestTOrderEntry.TearDown;

DependencyInjection/Intro/8-FieldInjection/Test/TestuOrderProcessor.pas

 implementation
 
 uses
-  uOrderMocks,
-  uOrderProcessor,
-  uServiceLocator;
+    uOrderMocks
+  , uOrderProcessor
+  , Spring.Container
+  , Spring.Services
+  ;
 
 procedure TestTOrderProcessor.TestProcessOrder;
 var
   aOrder: TOrder;
 begin
-  ServiceLocator.Build;
+  GlobalContainer.Build;
   // TODO: Setup method call parameters
-  FOrderProcessor := ServiceLocator.Resolve<IOrderProcessor>;
+  FOrderProcessor := ServiceLocator.GetService<IOrderProcessor>;
   aOrder := TOrder.Create;
   try
     Check(FOrderProcessor.ProcessOrder(aOrder));

DependencyInjection/Intro/8-FieldInjection/Test/TestuOrderValidator.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Container
+    , Spring.Services
     ;
 
 procedure TestTOrderValidator.SetUp;
 begin
-  ServiceLocator.Build;
-  FOrderValidator := ServiceLocator.Resolve<IOrderValidator>;
+  GlobalContainer.Build;
+  FOrderValidator := ServiceLocator.GetService<IOrderValidator>;
 end;
 
 procedure TestTOrderValidator.TearDown;

DependencyInjection/Intro/8-FieldInjection/Test/uOrderMocks.pas

 implementation
 
 uses
-      uServiceLocator
+      Spring.Container
     , uOrder
     , uOrderInterfaces
     ;
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TMockOrderEntry>.Implements<IOrderEntry>;
-  ServiceLocator.RegisterComponent<TMockOrderValidator>.Implements<IOrderValidator>;
+  GlobalContainer.RegisterComponent<TMockOrderEntry>.Implements<IOrderEntry>;
+  GlobalContainer.RegisterComponent<TMockOrderValidator>.Implements<IOrderValidator>;
 
 end.

DependencyInjection/Intro/8-FieldInjection/uDoOrderProcessing.pas

 
 uses
         uOrder
-      , uServiceLocator
+      , Spring.Container
+      , Spring.Services
       , uOrderInterfaces
-
       ;
 
 procedure DoOrderProcessing;
   Order: TOrder;
   OrderProcessor: IOrderProcessor;
 begin
-  ServiceLocator.Build;
+  GlobalContainer.Build;
   Order := TOrder.Create;
   try
-    OrderProcessor := ServiceLocator.Resolve<IOrderProcessor>;
+    OrderProcessor := ServiceLocator.GetService<IOrderProcessor>;
     if OrderProcessor.ProcessOrder(Order) then
     begin
       WriteLn('Order successfully processed....');

DependencyInjection/Intro/8-FieldInjection/uOrderEntry.pas

 implementation
 
 uses
-    uOrder, uOrderInterfaces, uServiceLocator;
+      uOrder
+    , uOrderInterfaces
+    , Spring.Container
+    ;
 
 type
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderEntry>.Implements<IOrderEntry>;
+  GlobalContainer.RegisterComponent<TOrderEntry>.Implements<IOrderEntry>;
 
 end.

DependencyInjection/Intro/8-FieldInjection/uOrderProcessor.pas

 implementation
 
 uses
-     uOrder, uOrderInterfaces, uServiceLocator, Spring;
+       uOrder
+     , uOrderInterfaces
+     , Spring.Container
+     , Spring.Services
+     ;
 
 type
   TOrderProcessor = class(TInterfacedObject, IOrderProcessor)
   private
     [Injection]
     FOrderValidator: IOrderValidator;
-    [Singleton]
     FOrderEntry: IOrderEntry;
   public
     function ProcessOrder(aOrder: TOrder): Boolean;
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderProcessor>.Implements<IOrderProcessor>. AsSingleton.InjectField('FOrderEntry');
+  GlobalContainer.RegisterComponent<TOrderProcessor>.Implements<IOrderProcessor>.InjectField('FOrderEntry');
+
 end.

DependencyInjection/Intro/8-FieldInjection/uOrderValidator.pas

 uses
      uOrder
    , uOrderInterfaces
-   , uServiceLocator;
+   , Spring.Container
+   ;
 
 type
 
 end;
 
 initialization
-  ServiceLocator.RegisterComponent<TOrderValidator>.Implements<IOrderValidator>;
+  GlobalContainer.RegisterComponent<TOrderValidator>.Implements<IOrderValidator>;
 end.

DependencyInjection/Intro/IntroToDependencyInjectionProjectGroup.groupproj

-	<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+	<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 		<PropertyGroup>
 			<ProjectGuid>{8F0B7B07-C38D-4FB9-A7CB-8BB20F272245}</ProjectGuid>
 		</PropertyGroup>
 			<Projects Include="1-StartingOut\StartingOut.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="1-StartingOut\Test\StartingOutTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="2-MoveToInterfaces\MovingToInterfaces.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="3-ConstructorInjection\ConstructorInjection.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="4-UseMocks\UseMocks.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="4-UseMocks\Test\UseMocksTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="5-IsolateInterfaces\IsolateInterfaces.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="6-UseContainer\UseContainer.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="6-UseContainer\Test\UseContainerTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="7-CustomConstructor\CustomConstructor.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="7-CustomConstructor\Test\CustomConstructorTests.dproj">
-				<Dependencies/>
-			</Projects>
 			<Projects Include="8-FieldInjection\FieldInjection.dproj">
 				<Dependencies/>
 			</Projects>
-			<Projects Include="8-FieldInjection\Test\FieldInjectionTests.dproj">
-				<Dependencies/>
-			</Projects>
 		</ItemGroup>
 		<ProjectExtensions>
 			<Borland.Personality>Default.Personality.12</Borland.Personality>
 		<Target Name="StartingOut:Make">
 			<MSBuild Projects="1-StartingOut\StartingOut.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="StartingOutTests">
-			<MSBuild Projects="1-StartingOut\Test\StartingOutTests.dproj"/>
-		</Target>
-		<Target Name="StartingOutTests:Clean">
-			<MSBuild Projects="1-StartingOut\Test\StartingOutTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="StartingOutTests:Make">
-			<MSBuild Projects="1-StartingOut\Test\StartingOutTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="MovingToInterfaces">
 			<MSBuild Projects="2-MoveToInterfaces\MovingToInterfaces.dproj"/>
 		</Target>
 		<Target Name="MovingToInterfaces:Make">
 			<MSBuild Projects="2-MoveToInterfaces\MovingToInterfaces.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="MovingToInterfacesTests">
-			<MSBuild Projects="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj"/>
-		</Target>
-		<Target Name="MovingToInterfacesTests:Clean">
-			<MSBuild Projects="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="MovingToInterfacesTests:Make">
-			<MSBuild Projects="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="ConstructorInjection">
 			<MSBuild Projects="3-ConstructorInjection\ConstructorInjection.dproj"/>
 		</Target>
 		<Target Name="ConstructorInjection:Make">
 			<MSBuild Projects="3-ConstructorInjection\ConstructorInjection.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="ConstructorInjectionTests">
-			<MSBuild Projects="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj"/>
-		</Target>
-		<Target Name="ConstructorInjectionTests:Clean">
-			<MSBuild Projects="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="ConstructorInjectionTests:Make">
-			<MSBuild Projects="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="UseMocks">
 			<MSBuild Projects="4-UseMocks\UseMocks.dproj"/>
 		</Target>
 		<Target Name="UseMocks:Make">
 			<MSBuild Projects="4-UseMocks\UseMocks.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="UseMocksTests">
-			<MSBuild Projects="4-UseMocks\Test\UseMocksTests.dproj"/>
-		</Target>
-		<Target Name="UseMocksTests:Clean">
-			<MSBuild Projects="4-UseMocks\Test\UseMocksTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="UseMocksTests:Make">
-			<MSBuild Projects="4-UseMocks\Test\UseMocksTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="IsolateInterfaces">
 			<MSBuild Projects="5-IsolateInterfaces\IsolateInterfaces.dproj"/>
 		</Target>
 		<Target Name="IsolateInterfaces:Make">
 			<MSBuild Projects="5-IsolateInterfaces\IsolateInterfaces.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="IsolateInterfaceTests">
-			<MSBuild Projects="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj"/>
-		</Target>
-		<Target Name="IsolateInterfaceTests:Clean">
-			<MSBuild Projects="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="IsolateInterfaceTests:Make">
-			<MSBuild Projects="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="UseContainer">
 			<MSBuild Projects="6-UseContainer\UseContainer.dproj"/>
 		</Target>
 		<Target Name="UseContainer:Make">
 			<MSBuild Projects="6-UseContainer\UseContainer.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="UseContainerTests">
-			<MSBuild Projects="6-UseContainer\Test\UseContainerTests.dproj"/>
-		</Target>
-		<Target Name="UseContainerTests:Clean">
-			<MSBuild Projects="6-UseContainer\Test\UseContainerTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="UseContainerTests:Make">
-			<MSBuild Projects="6-UseContainer\Test\UseContainerTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="CustomConstructor">
 			<MSBuild Projects="7-CustomConstructor\CustomConstructor.dproj"/>
 		</Target>
 		<Target Name="CustomConstructor:Make">
 			<MSBuild Projects="7-CustomConstructor\CustomConstructor.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="CustomConstructorTests">
-			<MSBuild Projects="7-CustomConstructor\Test\CustomConstructorTests.dproj"/>
-		</Target>
-		<Target Name="CustomConstructorTests:Clean">
-			<MSBuild Projects="7-CustomConstructor\Test\CustomConstructorTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="CustomConstructorTests:Make">
-			<MSBuild Projects="7-CustomConstructor\Test\CustomConstructorTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="FieldInjection">
 			<MSBuild Projects="8-FieldInjection\FieldInjection.dproj"/>
 		</Target>
 		<Target Name="FieldInjection:Make">
 			<MSBuild Projects="8-FieldInjection\FieldInjection.dproj" Targets="Make"/>
 		</Target>
-		<Target Name="FieldInjectionTests">
-			<MSBuild Projects="8-FieldInjection\Test\FieldInjectionTests.dproj"/>
-		</Target>
-		<Target Name="FieldInjectionTests:Clean">
-			<MSBuild Projects="8-FieldInjection\Test\FieldInjectionTests.dproj" Targets="Clean"/>
-		</Target>
-		<Target Name="FieldInjectionTests:Make">
-			<MSBuild Projects="8-FieldInjection\Test\FieldInjectionTests.dproj" Targets="Make"/>
-		</Target>
 		<Target Name="Build">
-			<CallTarget Targets="StartingOut;StartingOutTests;MovingToInterfaces;MovingToInterfacesTests;ConstructorInjection;ConstructorInjectionTests;UseMocks;UseMocksTests;IsolateInterfaces;IsolateInterfaceTests;UseContainer;UseContainerTests;CustomConstructor;CustomConstructorTests;FieldInjection;FieldInjectionTests"/>
+			<CallTarget Targets="StartingOut;MovingToInterfaces;ConstructorInjection;UseMocks;IsolateInterfaces;UseContainer;CustomConstructor;FieldInjection"/>
 		</Target>
 		<Target Name="Clean">
-			<CallTarget Targets="StartingOut:Clean;StartingOutTests:Clean;MovingToInterfaces:Clean;MovingToInterfacesTests:Clean;ConstructorInjection:Clean;ConstructorInjectionTests:Clean;UseMocks:Clean;UseMocksTests:Clean;IsolateInterfaces:Clean;IsolateInterfaceTests:Clean;UseContainer:Clean;UseContainerTests:Clean;CustomConstructor:Clean;CustomConstructorTests:Clean;FieldInjection:Clean;FieldInjectionTests:Clean"/>
+			<CallTarget Targets="StartingOut:Clean;MovingToInterfaces:Clean;ConstructorInjection:Clean;UseMocks:Clean;IsolateInterfaces:Clean;UseContainer:Clean;CustomConstructor:Clean;FieldInjection:Clean"/>
 		</Target>
 		<Target Name="Make">
-			<CallTarget Targets="StartingOut:Make;StartingOutTests:Make;MovingToInterfaces:Make;MovingToInterfacesTests:Make;ConstructorInjection:Make;ConstructorInjectionTests:Make;UseMocks:Make;UseMocksTests:Make;IsolateInterfaces:Make;IsolateInterfaceTests:Make;UseContainer:Make;UseContainerTests:Make;CustomConstructor:Make;CustomConstructorTests:Make;FieldInjection:Make;FieldInjectionTests:Make"/>
+			<CallTarget Targets="StartingOut:Make;MovingToInterfaces:Make;ConstructorInjection:Make;UseMocks:Make;IsolateInterfaces:Make;UseContainer:Make;CustomConstructor:Make;FieldInjection:Make"/>
 		</Target>
 		<Import Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')" Project="$(BDS)\Bin\CodeGear.Group.Targets"/>
 	</Project>

DependencyInjection/Intro/IntroToDependencyInjectionWithTestsProjectGroup.groupproj

+	<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+		<PropertyGroup>
+			<ProjectGuid>{8F0B7B07-C38D-4FB9-A7CB-8BB20F272245}</ProjectGuid>
+		</PropertyGroup>
+		<ItemGroup>
+			<Projects Include="1-StartingOut\StartingOut.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="1-StartingOut\Test\StartingOutTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="2-MoveToInterfaces\MovingToInterfaces.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="3-ConstructorInjection\ConstructorInjection.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="4-UseMocks\UseMocks.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="4-UseMocks\Test\UseMocksTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="5-IsolateInterfaces\IsolateInterfaces.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="6-UseContainer\UseContainer.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="6-UseContainer\Test\UseContainerTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="7-CustomConstructor\CustomConstructor.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="7-CustomConstructor\Test\CustomConstructorTests.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="8-FieldInjection\FieldInjection.dproj">
+				<Dependencies/>
+			</Projects>
+			<Projects Include="8-FieldInjection\Test\FieldInjectionTests.dproj">
+				<Dependencies/>
+			</Projects>
+		</ItemGroup>
+		<ProjectExtensions>
+			<Borland.Personality>Default.Personality.12</Borland.Personality>
+			<Borland.ProjectType/>
+			<BorlandProject>
+				<Default.Personality/>
+			</BorlandProject>
+		</ProjectExtensions>
+		<Target Name="StartingOut">
+			<MSBuild Projects="1-StartingOut\StartingOut.dproj"/>
+		</Target>
+		<Target Name="StartingOut:Clean">
+			<MSBuild Projects="1-StartingOut\StartingOut.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="StartingOut:Make">
+			<MSBuild Projects="1-StartingOut\StartingOut.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="StartingOutTests">
+			<MSBuild Projects="1-StartingOut\Test\StartingOutTests.dproj"/>
+		</Target>
+		<Target Name="StartingOutTests:Clean">
+			<MSBuild Projects="1-StartingOut\Test\StartingOutTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="StartingOutTests:Make">
+			<MSBuild Projects="1-StartingOut\Test\StartingOutTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="MovingToInterfaces">
+			<MSBuild Projects="2-MoveToInterfaces\MovingToInterfaces.dproj"/>
+		</Target>
+		<Target Name="MovingToInterfaces:Clean">
+			<MSBuild Projects="2-MoveToInterfaces\MovingToInterfaces.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="MovingToInterfaces:Make">
+			<MSBuild Projects="2-MoveToInterfaces\MovingToInterfaces.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="MovingToInterfacesTests">
+			<MSBuild Projects="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj"/>
+		</Target>
+		<Target Name="MovingToInterfacesTests:Clean">
+			<MSBuild Projects="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="MovingToInterfacesTests:Make">
+			<MSBuild Projects="2-MoveToInterfaces\Test\MovingToInterfacesTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="ConstructorInjection">
+			<MSBuild Projects="3-ConstructorInjection\ConstructorInjection.dproj"/>
+		</Target>
+		<Target Name="ConstructorInjection:Clean">
+			<MSBuild Projects="3-ConstructorInjection\ConstructorInjection.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="ConstructorInjection:Make">
+			<MSBuild Projects="3-ConstructorInjection\ConstructorInjection.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="ConstructorInjectionTests">
+			<MSBuild Projects="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj"/>
+		</Target>
+		<Target Name="ConstructorInjectionTests:Clean">
+			<MSBuild Projects="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="ConstructorInjectionTests:Make">
+			<MSBuild Projects="3-ConstructorInjection\Test\ConstructorInjectionTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="UseMocks">
+			<MSBuild Projects="4-UseMocks\UseMocks.dproj"/>
+		</Target>
+		<Target Name="UseMocks:Clean">
+			<MSBuild Projects="4-UseMocks\UseMocks.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="UseMocks:Make">
+			<MSBuild Projects="4-UseMocks\UseMocks.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="UseMocksTests">
+			<MSBuild Projects="4-UseMocks\Test\UseMocksTests.dproj"/>
+		</Target>
+		<Target Name="UseMocksTests:Clean">
+			<MSBuild Projects="4-UseMocks\Test\UseMocksTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="UseMocksTests:Make">
+			<MSBuild Projects="4-UseMocks\Test\UseMocksTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="IsolateInterfaces">
+			<MSBuild Projects="5-IsolateInterfaces\IsolateInterfaces.dproj"/>
+		</Target>
+		<Target Name="IsolateInterfaces:Clean">
+			<MSBuild Projects="5-IsolateInterfaces\IsolateInterfaces.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="IsolateInterfaces:Make">
+			<MSBuild Projects="5-IsolateInterfaces\IsolateInterfaces.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="IsolateInterfaceTests">
+			<MSBuild Projects="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj"/>
+		</Target>
+		<Target Name="IsolateInterfaceTests:Clean">
+			<MSBuild Projects="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="IsolateInterfaceTests:Make">
+			<MSBuild Projects="5-IsolateInterfaces\Test\IsolateInterfaceTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="UseContainer">
+			<MSBuild Projects="6-UseContainer\UseContainer.dproj"/>
+		</Target>
+		<Target Name="UseContainer:Clean">
+			<MSBuild Projects="6-UseContainer\UseContainer.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="UseContainer:Make">
+			<MSBuild Projects="6-UseContainer\UseContainer.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="UseContainerTests">
+			<MSBuild Projects="6-UseContainer\Test\UseContainerTests.dproj"/>
+		</Target>
+		<Target Name="UseContainerTests:Clean">
+			<MSBuild Projects="6-UseContainer\Test\UseContainerTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="UseContainerTests:Make">
+			<MSBuild Projects="6-UseContainer\Test\UseContainerTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="CustomConstructor">
+			<MSBuild Projects="7-CustomConstructor\CustomConstructor.dproj"/>
+		</Target>
+		<Target Name="CustomConstructor:Clean">
+			<MSBuild Projects="7-CustomConstructor\CustomConstructor.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="CustomConstructor:Make">
+			<MSBuild Projects="7-CustomConstructor\CustomConstructor.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="CustomConstructorTests">
+			<MSBuild Projects="7-CustomConstructor\Test\CustomConstructorTests.dproj"/>
+		</Target>
+		<Target Name="CustomConstructorTests:Clean">
+			<MSBuild Projects="7-CustomConstructor\Test\CustomConstructorTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="CustomConstructorTests:Make">
+			<MSBuild Projects="7-CustomConstructor\Test\CustomConstructorTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="FieldInjection">
+			<MSBuild Projects="8-FieldInjection\FieldInjection.dproj"/>
+		</Target>
+		<Target Name="FieldInjection:Clean">
+			<MSBuild Projects="8-FieldInjection\FieldInjection.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="FieldInjection:Make">
+			<MSBuild Projects="8-FieldInjection\FieldInjection.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="FieldInjectionTests">
+			<MSBuild Projects="8-FieldInjection\Test\FieldInjectionTests.dproj"/>
+		</Target>
+		<Target Name="FieldInjectionTests:Clean">
+			<MSBuild Projects="8-FieldInjection\Test\FieldInjectionTests.dproj" Targets="Clean"/>
+		</Target>
+		<Target Name="FieldInjectionTests:Make">
+			<MSBuild Projects="8-FieldInjection\Test\FieldInjectionTests.dproj" Targets="Make"/>
+		</Target>
+		<Target Name="Build">
+			<CallTarget Targets="StartingOut;StartingOutTests;MovingToInterfaces;MovingToInterfacesTests;ConstructorInjection;ConstructorInjectionTests;UseMocks;UseMocksTests;IsolateInterfaces;IsolateInterfaceTests;UseContainer;UseContainerTests;CustomConstructor;CustomConstructorTests;FieldInjection;FieldInjectionTests"/>
+		</Target>
+		<Target Name="Clean">
+			<CallTarget Targets="StartingOut:Clean;StartingOutTests:Clean;MovingToInterfaces:Clean;MovingToInterfacesTests:Clean;ConstructorInjection:Clean;ConstructorInjectionTests:Clean;UseMocks:Clean;UseMocksTests:Clean;IsolateInterfaces:Clean;IsolateInterfaceTests:Clean;UseContainer:Clean;UseContainerTests:Clean;CustomConstructor:Clean;CustomConstructorTests:Clean;FieldInjection:Clean;FieldInjectionTests:Clean"/>
+		</Target>
+		<Target Name="Make">
+			<CallTarget Targets="StartingOut:Make;StartingOutTests:Make;MovingToInterfaces:Make;MovingToInterfacesTests:Make;ConstructorInjection:Make;ConstructorInjectionTests:Make;UseMocks:Make;UseMocksTests:Make;IsolateInterfaces:Make;IsolateInterfaceTests:Make;UseContainer:Make;UseContainerTests:Make;CustomConstructor:Make;CustomConstructorTests:Make;FieldInjection:Make;FieldInjectionTests:Make"/>
+		</Target>
+		<Import Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')" Project="$(BDS)\Bin\CodeGear.Group.Targets"/>
+	</Project>

SpringDemos/Demo.Patterns/Observer/ObserverPatternDemoProject.dpr

+program ObserverPatternDemoProject;
+
+uses
+  Vcl.Forms,
+  frmObserverPattern in 'frmObserverPattern.pas' {Form28},
+  uObserverDemo in 'uObserverDemo.pas';
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.MainFormOnTaskbar := True;
+  Application.CreateForm(TForm28, Form28);
+  Application.Run;
+end.

SpringDemos/Demo.Patterns/Observer/ObserverPatternDemoProject.dproj

+	<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+		<PropertyGroup>
+			<ProjectGuid>{AAD9A12B-73E1-4E3E-BC32-76EC8BD4DAB4}</ProjectGuid>
+			<ProjectVersion>13.4</ProjectVersion>
+			<FrameworkType>VCL</FrameworkType>
+			<MainSource>ObserverPatternDemoProject.dpr</MainSource>
+			<Base>True</Base>
+			<Config Condition="'$(Config)'==''">Debug</Config>
+			<Platform Condition="'$(Platform)'==''">Win32</Platform>
+			<TargetedPlatforms>1</TargetedPlatforms>
+			<AppType>Application</AppType>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+			<Base_Win64>true</Base_Win64>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+			<Base_Win32>true</Base_Win32>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
+			<Cfg_1>true</Cfg_1>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+			<Cfg_1_Win32>true</Cfg_1_Win32>
+			<CfgParent>Cfg_1</CfgParent>
+			<Cfg_1>true</Cfg_1>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+			<Cfg_2>true</Cfg_2>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Base)'!=''">
+			<DCC_UsePackage>bindcompfmx;fmx;rtl;dbrtl;IndySystem;DbxClientDriver;bindcomp;inetdb;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;xmlrtl;DbxCommonDriver;IndyProtocols;DBXMySQLDriver;dbxcds;bindengine;soaprtl;DBXOracleDriver;dsnap;DBXInformixDriver;IndyCore;fmxase;DBXFirebirdDriver;inet;fmxobj;inetdbxpress;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IPIndyImpl;$(DCC_UsePackage)</DCC_UsePackage>
+			<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
+			<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
+			<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
+			<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
+			<DCC_E>false</DCC_E>
+			<DCC_N>false</DCC_N>
+			<DCC_S>false</DCC_S>
+			<DCC_F>false</DCC_F>
+			<DCC_K>false</DCC_K>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Base_Win64)'!=''">
+			<DCC_UsePackage>DBXOdbcDriver;DBXSybaseASEDriver;vclimg;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;DBXDb2Driver;websnap;VclSmp;vcl;DBXMSSQLDriver;dsnapcon;vclx;webdsnap;$(DCC_UsePackage)</DCC_UsePackage>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Base_Win32)'!=''">
+			<DCC_UsePackage>vcldbx;frx16;TeeDB;Rave100VCL;vclib;Tee;inetdbbde;DBXOdbcDriver;svnui;ibxpress;DBXSybaseASEDriver;vclimg;frxDB16;intrawebdb_120_160;fmi;fs16;FMXTee;TeeUI;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;Intraweb_120_160;DBXDb2Driver;websnap;vclribbon;frxe16;VclSmp;fsDB16;vcl;DataSnapConnectors;CloudService;DBXMSSQLDriver;CodeSiteExpressPkg;FmxTeeUI;dsnapcon;vclx;webdsnap;svn;bdertl;adortl;$(DCC_UsePackage)</DCC_UsePackage>
+			<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+			<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+			<VerInfo_Locale>1033</VerInfo_Locale>
+			<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+			<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Cfg_1)'!=''">
+			<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+			<DCC_Optimize>false</DCC_Optimize>
+			<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+			<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
+			<DCC_RemoteDebug>true</DCC_RemoteDebug>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+			<DCC_RemoteDebug>false</DCC_RemoteDebug>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Cfg_2)'!=''">
+			<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+			<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+			<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+			<DCC_DebugInformation>false</DCC_DebugInformation>
+		</PropertyGroup>
+		<ItemGroup>
+			<DelphiCompile Include="$(MainSource)">
+				<MainSource>MainSource</MainSource>
+			</DelphiCompile>
+			<DCCReference Include="frmObserverPattern.pas">
+				<Form>Form28</Form>
+				<FormType>dfm</FormType>
+			</DCCReference>
+			<DCCReference Include="uObserverDemo.pas"/>
+			<BuildConfiguration Include="Release">
+				<Key>Cfg_2</Key>
+				<CfgParent>Base</CfgParent>
+			</BuildConfiguration>
+			<BuildConfiguration Include="Base">
+				<Key>Base</Key>
+			</BuildConfiguration>
+			<BuildConfiguration Include="Debug">
+				<Key>Cfg_1</Key>
+				<CfgParent>Base</CfgParent>
+			</BuildConfiguration>
+		</ItemGroup>
+		<ProjectExtensions>
+			<Borland.Personality>Delphi.Personality.12</Borland.Personality>
+			<Borland.ProjectType/>
+			<BorlandProject>
+				<Delphi.Personality>
+					<VersionInfo>
+						<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
+						<VersionInfo Name="AutoIncBuild">False</VersionInfo>
+						<VersionInfo Name="MajorVer">1</VersionInfo>
+						<VersionInfo Name="MinorVer">0</VersionInfo>
+						<VersionInfo Name="Release">0</VersionInfo>
+						<VersionInfo Name="Build">0</VersionInfo>
+						<VersionInfo Name="Debug">False</VersionInfo>
+						<VersionInfo Name="PreRelease">False</VersionInfo>
+						<VersionInfo Name="Special">False</VersionInfo>
+						<VersionInfo Name="Private">False</VersionInfo>
+						<VersionInfo Name="DLL">False</VersionInfo>
+						<VersionInfo Name="Locale">1033</VersionInfo>
+						<VersionInfo Name="CodePage">1252</VersionInfo>
+					</VersionInfo>
+					<VersionInfoKeys>
+						<VersionInfoKeys Name="CompanyName"/>
+						<VersionInfoKeys Name="FileDescription"/>
+						<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+						<VersionInfoKeys Name="InternalName"/>
+						<VersionInfoKeys Name="LegalCopyright"/>
+						<VersionInfoKeys Name="LegalTrademarks"/>
+						<VersionInfoKeys Name="OriginalFilename"/>
+						<VersionInfoKeys Name="ProductName"/>
+						<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+						<VersionInfoKeys Name="Comments"/>
+					</VersionInfoKeys>
+					<Source>
+						<Source Name="MainSource">ObserverPatternDemoProject.dpr</Source>
+					</Source>
+				</Delphi.Personality>
+				<Deployment/>
+				<Platforms>
+					<Platform value="Win64">False</Platform>
+					<Platform value="Win32">True</Platform>
+				</Platforms>
+			</BorlandProject>
+			<ProjectFileVersion>12</ProjectFileVersion>
+		</ProjectExtensions>
+		<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+		<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+	</Project>
Add a comment to this file

SpringDemos/Demo.Patterns/Observer/ObserverPatternDemoProject.res

Binary file added.

SpringDemos/Demo.Patterns/Observer/frmObserverPattern.dfm

+object Form28: TForm28
+  Left = 0
+  Top = 0
+  Caption = 'Observer Pattern Demo'
+  ClientHeight = 300
+  ClientWidth = 635
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'Tahoma'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Edit1: TEdit
+    Left = 160
+    Top = 56
+    Width = 121
+    Height = 21
+    TabOrder = 0
+    Text = 'Edit1'
+  end
+  object Edit2: TEdit
+    Left = 160
+    Top = 83
+    Width = 121
+    Height = 21
+    TabOrder = 1
+    Text = 'Edit2'
+  end
+  object Timer1: TTimer
+    OnTimer = Timer1Timer
+    Left = 48
+    Top = 48
+  end
+end

SpringDemos/Demo.Patterns/Observer/frmObserverPattern.pas

+unit frmObserverPattern;
+
+interface
+
+uses
+  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
+  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, uObserverDemo;
+
+type
+  TForm28 = class(TForm)
+    Timer1: TTimer;
+    Edit1: TEdit;
+    Edit2: TEdit;
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure Timer1Timer(Sender: TObject);
+  private
+    FEditorMonitor: TEditorMonitor;
+  end;
+
+var
+  Form28: TForm28;
+
+implementation
+
+{$R *.dfm}
+
+procedure TForm28.FormCreate(Sender: TObject);
+begin
+  FEditorMonitor := TEditorMonitor.Create;
+
+  FEditorMonitor.AddListener(TCurrentTimeEditUpdater.Create(Edit1));
+  FEditorMonitor.AddListener(TTickTimeEditUpdater.Create(Edit2));
+end;
+
+procedure TForm28.FormDestroy(Sender: TObject);
+begin
+  FEditorMonitor.Free;
+end;
+
+procedure TForm28.Timer1Timer(Sender: TObject);
+var
+  UpdateProc: TProc<TEditUpdater>;
+begin
+  UpdateProc := procedure(aEditUpdater: TEditUpdater)
+                begin
+                  aEditUpdater.Update;
+                end;
+
+  FEditorMonitor.NotifyListeners(UpdateProc);
+end;
+
+end.

SpringDemos/Demo.Patterns/Observer/uObserverDemo.pas

+unit uObserverDemo;
+
+interface
+
+uses
+      Spring.DesignPatterns
+    , VCL.StdCtrls
+    ;
+
+type
+
+  TEditUpdater =  class abstract
+  private
+    FEdit: TEdit;
+  public
+    constructor Create(aEdit: TEdit);
+    procedure Update; virtual; abstract;
+    property Edit: TEdit read FEdit;
+  end;
+
+  TCurrentTimeEditUpdater = class(TEditUpdater)
+    procedure Update; override;
+  end;
+
+  TTickTimeEditUpdater = class(TEditUpdater)
+    procedure Update; override;
+  end;
+
+  TEditorMonitor = class(TObservable<TEditUpdater>)
+    destructor Destroy; override;
+  end;
+
+implementation
+
+{ TEditUpdater }
+
+uses
+       SysUtils
+     , Windows
+     ;
+
+constructor TEditUpdater.Create(aEdit: TEdit);
+begin
+  inherited Create;
+  FEdit := aEdit;
+end;
+
+
+{ TCurrentTimeEditUpdater }
+
+procedure TCurrentTimeEditUpdater.Update;
+begin
+  inherited;
+  FEdit.Text := DateTimeToStr(Now);
+end;
+
+{ TTickTimeEditUpdater }
+
+procedure TTickTimeEditUpdater.Update;
+begin
+  inherited;
+  FEdit.Text := IntToStr(GetTickCount);
+end;
+
+{ TEditorMonitor }
+
+destructor TEditorMonitor.Destroy;
+var
+  aEditUpdater: TEditUpdater;
+begin
+  for aEditUpdater in Listeners do
+  begin
+    aEditUpdater.Free;
+  end;
+
+  inherited;
+end;
+
+end.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.