The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,470 other followers

Archive for January 13th, 2021

The difference between thread-safety and re-entrancy – The Old New Thing

Posted by jpluimers on 2021/01/13

Just in case I need a nice example about the difference: [WayBack] The difference between thread-safety and re-entrancy – The Old New Thing.

It has both that and the definition:

An operation is “thread-safe” if it can be performed from multiple threads safely, even if the calls happen simultaneously on multiple threads.

An operation is re-entrant if it can be performed while the operation is already in progress (perhaps in another context). This is a stronger concept than thread-safety, because the second attempt to perform the operation can even come from within the same thread.

–jeroen

Posted in Conference Topics, Conferences, Development, Event, Software Development | Leave a Comment »

Programming Wisdom auf Twitter: ““Good code is its own best documentation. As you’re about to add a comment, ask yourself, “How can I improve the code so that this comment isn’t needed?” Improve the code and then document it to make it even clearer.” – Steve McConnell”

Posted by jpluimers on 2021/01/13

[WayBackProgramming Wisdom auf Twitter: ““Good code is its own best documentation. As you’re about to add a comment, ask yourself, “How can I improve the code so that this comment isn’t needed?” Improve the code and then document it to make it even clearer.” – Steve McConnell”

Code the why in a clean and understandable way.

Then document the how, and clear up any implementation/usage details that are hard to understand.

–jeroen

Posted in Development, Software Development | Leave a Comment »

Delphi TVirtualMethodInterceptor like magic: some links of useful stuff made with it

Posted by jpluimers on 2021/01/13

I think TVirtualMethodInterceptor is a really nice things added to Delphi XE: it allows you to overwrite virtual methods of a class.

Since the documentation from that era cannot be saved in the WayBack machine, here is some more recent documentation:

Over the years, the underlying RTTI has been improved, so it can now do more than in the past, but is still cumbersome to use, see for instance [WayBack] tutorial script delphi Changing component class at run-time on demand – CODE Q&A Solved and [WayBack] TVirtualMethodInterceptor (Delphi) – RAD Studio Code Examples and [WayBack] Entropy Overload: Virtual method interception and [WayBack] Playing around with TVirtualMethodInterceptor | Delphi Haven with TVirtualMethodLogger.

Luckily there are more powerful alternatives based on the same ideas and/or underlying implementationIn fact, it can do so much for instance on the Spring4D and DSharp frameworks.

A demo is at [WayBack] Delphi sorcery: Pimp your unit tests using mock objects or [WayBack] Delphi sorcery: AOP and duck typing in Delphi.

The demo of the mocking framework was at code.google.com/archive/p/delphisorcery, but now is part of bitbucket.org/sglienke/dsharp at bitbucket.org/sglienke/dsharp/src/master/Source/Testing.

Some relevant directories:

Basically it is a playground for the more often updated and stable Spring4D where these directories and files are relevant:

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

 
%d bloggers like this: