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 4,262 other subscribers

Archive for August 18th, 2020

Nick Hodges on SOLID in TypeScript using Angular

Posted by jpluimers on 2020/08/18

For my link archive: after a long history of Delphi programming, Nick Hodges did a

SOLID series with TypeScript using Angular

They explain these SOLID – Wikipedia concepts:

  1. Single responsibility principle – Wikipedia
  2. Open–closed principle – Wikipedia
  3. Liskov substitution principle – Wikipedia
  4. Interface segregation principle – Wikipedia
  5. Dependency inversion principle – Wikipedia

After that, he did a series on:

[WayBack] Angular 101 – Angles and Types

More Angular and TypeScript

Since Nick likes that combination so much:

and his TypeScript series start:

and what started as a trilogy in 5 parts of his [WayBack] Angular 101 – Angles and Types became much longer:

Related:

DIID update

Nick also updated the public repository with the changes that did make it in his Dependency injection in Delphi book earlier:

–jeroen

Read the rest of this entry »

Posted in Design Patterns, Development, Scripting, Software Development, TypeScript | Leave a Comment »

In the series “avoid Variants when coding in Delphi”: the comparison operator

Posted by jpluimers on 2020/08/18

For Variant types, the = comparison operator in Delphi maps to the VarCompareValue in the Variants unit.

That function fails to handle various comparisons and for some it knows it can handle raises a VarInvalidOp through various code paths (like CheckType) to VarInvalidOp because the implementation limits itself to varEmpty..varUInt64, which I think means that these are unsupported:

  • varRecord
  • varStrArg
  • varObject
  • varUStrArg
  • varString
  • varAny
  • varUString
  • varArray
  • varByRef

This fails when using the = operator:

What is this code supposed to do, if v1 and v2 are variant arrays with the same content?

if v1 = v2 then
  WriteLn('equal')
else
  WriteLn('not equal');

Spring4d has a function SameValue in the Spring.pas unit which handles more cases, at least the case when both operands are arrays having the same content.

Source: [WayBack] I think I may have mentioned that I hate Variants: What is this code supposed to do, if v1 and v2 are variant arrays with the same content? if v1 = v2… – Thomas Mueller (dummzeuch) – Google+

Thanks to Thomas Mueller and Stefan Glienke for this.

–jeroen

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

Some PlantUML links I needed for complex component diagram editing

Posted by jpluimers on 2020/08/18

A while ago, I had to create a bit more complex component diagrams than the simple ones I used to create in PlantUML.

Some links that helped me:

UML2 style examples for skinparam that are equivalent:

skinparam component {
  Style uml2
}
skinparam {
  componentStyle uml2
}

Read the rest of this entry »

Posted in Development, Diagram, PlantUML, Software Development, UML | Leave a Comment »