-
Content Count
267 -
Joined
-
Last visited
-
Days Won
2
Posts posted by Jacek Laskowski
-
-
2 hours ago, Stefan Glienke said:Does the implementing class itself has dependencies the container should build?
Yes, I have class with IEqualityComparer<T> in constructor, so I need the container to be able to resolve this interface... but this is impossible?
TMyClass<T> = class(TInterfacedObject, IMyInterface) constructor Create(const aKeyComparer : IEqualityComparer<T>); end;
-
Is it possible to register a generic class implementing the delphi IEqualityComparer<T> in the Spring container? This interface does not have a GUID and RegisterType generates an error. How to do it?
-
I knew that you're sticking to it ... 🙂
I try to eliminate warnings from my own code, but I have warnings from external libraries, eg Synapse, DCPCrypt and others. -
Is there any tool that can scan the project and show unused local variables?
I know that the compiler shows it, but it is not very clear in the log filled with various warnings.
-
5 hours ago, PeterBelow said:A clear case of premature optimization, IMO 😉
the temptation to optimize is sometimes so great... 😉
-
1
-
-
Maybe green and gray circle would be enough? Without plus or minus sign? Green for interface, gray for implementation (gray as in shadow, hidden).
-
The class design is rather good, the override detection I need in order to optimize performance (class implements cache in the REST server).
The ancestor (in base class) method returns always False, the descendant method can change this behavior, but if it does not change, I prefer to check the boolean flag rather than call the method (just because it's faster). -
Thanks for both solutions, I use Spring4D, but "seek" way is worth attention too (and probably faster).
-
Such a simple example with inheritance:
TAncestor = class procedure MethodX(); virtual procedure Do(); end; TDescendantA = class(TAncestor) //override MethodX procedure MethodX(); override; end; TDescendantB = class(TAncestor) //no override MethodX end; procedure TAncestor.Do(); begin how to check if MethodX is overridden? <<<<<<<<<<<<<<<<<<<< end; var A : TDescendatdA; B : TDescendantB; begin A := TDescendatdA.Create; B := TDescendatdB.Create; A.Do(); B.Do();
How to check if MethodX is overridden?
-
-
23 hours ago, Primož Gabrijelčič said:Alternatives:
- Named pipes, https://docs.microsoft.com/en-us/windows/desktop/ipc/named-pipes
- TCP/IP
- Network DDE, https://docs.microsoft.com/en-us/windows/desktop/ipc/network-dynamic-data-exchange
- Mailslots, https://docs.microsoft.com/en-us/windows/desktop/ipc/mailslots
from Microsft site:
" [Network DDE is no longer supported. Nddeapi.dll is present on Windows Vista, but all function calls return NDDE_NOT_IMPLEMENTED.] "
-
1
-
-
Maybe instead of thinking up a language, use TypeScript? In JS (and TS), JSON automatically becomes an object (Java Script Object Notation).
-
1
-
-
what about thread safety?
-
Yes, quality lies and cries. Recently, I have been working a little in VSCode and the node.js ecosystem. Environmental quality is ahead of Delphi for ages. In addition, it works steadily and quickly, although behind the scenes everything is based on slow JS!
I have serious doubts that Delphi will ever catch up with the world in this area.
-
-
GExperts?
-
Chakra is open source, under the liberal MIT license, it doesn't have to die with Edge.
-
Then try to debug the GZIP usage or place of parsing response headers.
IMHO Rio has many errors in HTTPClient classes, see:
-
try to debug HTTPClient after exit from this event
-
-
"The number 42 is, in The Hitchhiker's Guide to the Galaxy by Douglas Adams, the "Answer to the Ultimate Question of Life, the Universe, and Everything", calculated by an enormous supercomputer named Deep Thought over a period of 7.5 million years. "
Yes, I was looking for that! 🙂
-
I register classes and factories in Spring:
container.RegisterType<TMyClass>; container.RegisterFactory<TMyClassFactory>;
Then in the code I use:
fClassFactory: TMyClassFactory; [...] begin lMyClass: = fClassFactory(); [some code] lMyClass.Free; <- who is responsible? end;
Who is responsible for the release of the object? Spring or me? -
I install WinDbg, but where is "Configure Symbols" window?
Spring4D and IEqualityComparer<T>
in RTL and Delphi Object Pascal
Posted
Ok, I paste more code with real example: