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.
Questions tagged [spring4d]
144 questions
0
votes
1 answer
Spring4d - Constructor with interface and object as parameters
For example I have 3 frames like this:
TBaseFrame = class(TFrame)
end;
TfraDataAwareEntity = class(TBaseFrame )
private
FEntity: TObject;
procedure SetEntity(const Value: TObject);
{ Private declarations }
public
constructor…

Marcelo Ribeiro
- 15
- 1
- 3
0
votes
1 answer
Spring4d custom BuilderInspector not called
I have many objects registered in Spring4d container,some as Singleton.When Application shutdown almost Singletons correct call own Destroy,but some no and FastMM reports Memory leaks.
I'm looking for a way,how Log which objects have problem.
I try…

egroups
- 23
- 7
0
votes
1 answer
Does Spring4d support inheritance of Entities?
I have two tables in my database representing an inheritance association as you can see below:
table person:
row_id name
1 Fred
2 Jack
table customer:
row_id credit_limit
1 1000.00
2 2000.00
And I mapped these tables…

Marcos George
- 1
- 1
0
votes
0 answers
Blinking caret missing in FireMonkey app when using delegate creation for MainForm
I am using the Spring4D mobile app demo code to instantiate the MainForm using the TContainer with a DelegateTo() method, as shown below. The code works fine to show the MainForm.
However, the TEdit on the MainForm does not have a blinking caret…

Rick Wheeler
- 1,142
- 10
- 22
0
votes
1 answer
Spring4D - When registering a type with a container is it possible to specify only the arguments you want to override in InjectConstructor()?
Given a type and registration of
TTest = class
public
constructor Create(First, Second: IO; Other: TOther);
end;
GlobalContainer.RegisterType;
GlobalContainer.RegisterType.AsDefault;
…

Richard Shuck
- 113
- 1
- 10
0
votes
2 answers
How to use lazy initialization together with DIContainer in Spring4D
I'm new to Spring4D and trying to understand how to combine DIContainers with lazy loaded objects. I think i get the concept of pushing all the creation of the objects back in the callstack to the root of the application and register the types and…

user2663901
- 53
- 3
0
votes
1 answer
How does the Spring4D [inject] attribute function internally?
I'm trying to create a minimal example, that does the same thing as the Spring4D [inject] Attribute. It's supposed to automatically resolve my TOrderAdapter.FDetailsAdapter, which I want to manually instantiate inside a Factory unit (not like the…

Phil
- 23
- 4
0
votes
1 answer
How to mock a function that has constant array and anonymous function as parameters
I have an interface function that has a constant array and an anonymous function as parameters:
TCodeword = array[0..7] of Char;
TIntFunc = reference to function: Integer;
IMyInterface = interface(IInvokable)
function DoSomething(const…

Peter Pohl
- 17
- 1
0
votes
0 answers
Spring4D TObjectList destructs if used in inherited class
I have created a TMyList-class that inherited from the Delphi TObjectList. After changing it to a TObjectList from Spring4D, I have an issue using the enumerator.
I we use the enumerator somewhere in the code, the object will be destroyed as…

Laurens
- 325
- 2
- 12
0
votes
0 answers
Getting RTTI information on a smart pointer
Using Spring, when I declare a smart pointer for a record
SmartPerson = IShared;
And then create it
Smartperson := Shared.Make;
*by the way, think this is really cool.
How then do I go about getting RTTI on the smart pointer?…

Derek Seymour
- 151
- 1
- 9
0
votes
1 answer
Is there any delayed MultiCast-Event, which is able to be interruptable?
I am looking for an interruptable, delayed event, which I hope could be already part of Spring4D, or easily implemented there.
What would be best way anyway, to achieve this ?
Probably the Event wouldn't be the right place.
Basically looking for…

Rollo62
- 1
- 1
0
votes
1 answer
Spring4D latest not compatible with DSharp?
I downloaded Spring4D "sglienke-spring4d-ca8037a2fdec.zip" from this link https://bitbucket.org/sglienke/spring4d/downloads/.
And I downloaded DSharp "sglienke-dsharp-2eae62962442.zip" from this link…

Wuping Xin
- 120
- 5
0
votes
1 answer
Memory issues when using spring.Nullable with DUnitX
Recently at my company we tried to use DUnitX with all it's blessings to test classes we wrote. Since those classes reflect entities in database all fields have to accept null values as well as specific type (e. g. Integer or string).
Since spring4d…

Łukasz Smoczyński
- 33
- 5
0
votes
1 answer
How inject object to class not registered in container?
I have three classes.
Class TA uses TB,
Class TB uses TC.
In container I have registered TA and TC, TB is not required to be registered.
procedure Project;
var
a: TA;
begin
GlobalContainer.RegisterType.AsSingleton;
…

aQuu
- 565
- 8
- 18
0
votes
0 answers
Spring4D TObjectDataSet Arabic charactes in win 10
I am using Sprinfg4D TObjectDataSet in a project, all is perfect in windows 7, but wheen i move the application to windows 10 , the fields with arabic characters seem not woking correctly, in SqlSevrer DB all is perfect except the UI, specialy the…

web master
- 27
- 6