Questions tagged [spring4d]

Spring Framework for Delphi (Spring4D for short) is an open-source code library targeting Delphi 2010 onward. It includes mostly a Dependency Injection Framework and a Base Class Library among other modules.

144 questions
1
vote
1 answer

How to use the TObservable.RemoveListener() in Delphi Spring Framework?

In the Delphi Spring framework there is an example on how to use TObservable.AddListener() in the \Spring4D\Samples\SpringDemos\Demo.Patterns\Observer folder. But there is not an example showing how to use TObservable.RemoveListener(). Here I add a…
Fabio Vitale
  • 2,257
  • 5
  • 28
  • 38
0
votes
1 answer

How to use Guard in place of Assert in TestInsight.DUnitX

I want to use the TestInsight.DUnitX with guard (Spring4D) but I get message 'No assertions were made during the test' Is it possible to use the guard class in place of the assert?
Ravaut123
  • 2,764
  • 31
  • 46
0
votes
0 answers

Memory leak when using Spring.Collections.IMultiMap

Does anyone else have a problem with memory leaks when using Spring4D framework and IMultiMap collections? I use the last released version from the master branch (1.2.6), and when I use the ForEach(Action) method, it generates a…
urkainian
  • 13
  • 3
0
votes
1 answer

Spring4D Dependency Injection in Delphi with dynamic library

Spring4D seems to do a very good job for Dependency injection in Delphi. I only started to experiment with it recently and things were working fine until I tried to use it in a dynamic library. The main application registers a class via an interface…
Nicko
  • 136
  • 2
  • 6
0
votes
0 answers

Searching for TObjectDictionary in Spring4D Framework

I'am staring to use the Spring4D Framework for Delphi because of its Collections methods that delivers interfaces and all sort of other cool stuff. I was wondering If there is a Interface I can use, when I need a Dictionary with a Class and that…
fisi-pjm
  • 378
  • 2
  • 16
0
votes
1 answer

Spring4D Mock error when assigning interface

With the these declarations: type IMyIfc = interface(IInvokable) ['{11D3AAF1-7A3E-45CA-9FB4-090010A29FC5}'] function Test: integer; end; IMySecondIfc = interface(IInvokable) ['{3360E5DB-6EDD-4F6E-A8C5-B2FB0ED7C0CD}'] function…
Anders G
  • 33
  • 1
  • 6
0
votes
1 answer

Delphi Spring4D Adapters units

I just installed Spring4D to test, but it cannot find the Spring.Persistence.Adapters units. I tried to install of multiple ways, put all the folders manually in my IDE library, but still cannot find any adapter. If I add a adapter unit manually, it…
missingNO
  • 29
  • 3
0
votes
1 answer

How to create a descendant of Spring4D IList?

I am new convert to Spring4D. I have been experimenting with it by converting some exiting code and I came across this: {Using System.Generics.Collections} TDenonInputList = class(TObjectList) private function…
Greg Dawson
  • 145
  • 8
0
votes
1 answer

In Spring4D how to register multiple auto factories for same interface

I want to provide the constructor arguments to the following class via the container but am unable to find a way of registering the multiple auto factories. TItemFactory = class(TInterfacedObject, IItemFactory) private fFactories:…
Richard Shuck
  • 113
  • 1
  • 10
0
votes
2 answers

Delphi RTTI 'Invalid class typecast' when assigning property of record type

I'm using a Delphi record type to store a Double value and then defining Implicit operators to handle assignment & conversion to different types. Everything works great for simple operations, however when using RTTI it bombs out with an invalid…
Rick Wheeler
  • 1,142
  • 10
  • 22
0
votes
0 answers

Marshmallow with TGUID and Oracle

I'm mapping my table with a TGuid type ID, the select works fine, but the inserts return an error stating that the TGuid type fields are not supported. How this mapping should be performed so that the includes and updates work between Marshmallow…
0
votes
1 answer

BeforeResolve/AfterResolve in Spring4D

This is my second attempt to explain what I am trying to accomplish as I did not explain it very well before. for this Pseudo example if you have the classes to resolve setup as below; TOuter.constructor.Create(Name: TName; Inner1, Inner2:…
Richard Shuck
  • 113
  • 1
  • 10
0
votes
1 answer

In Spring4D is it not possible to register a TPair?

The following code gives the error 'Incomplete registration for type: TPair' but for the life of me I can't figure out what is missing. I even tried registering String. var Container:=TContainer.Create; try …
Richard Shuck
  • 113
  • 1
  • 10
0
votes
0 answers

Spring4D Marshmallow and TGuid fields

how could I use TGuid type fields together with the Marshmallow ORM? Methods like FindOne, for example, expect parameters of type TValue and when trying to use im TGuid, the error occurs: incompatible types: TValue and TGUID. thanks. some…
0
votes
1 answer

spring4D dependency injector with MVP

I'm using Spring4D's dependency injector in something organized as MVP, in my view I have the interface reference of my presenter and in the create method of the presenter I have the injection of the view's interface in the constructor, the view is…