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 1,854 other subscribers

Archive for the ‘Software Development’ Category

When CCP is not about clearing financial transactions

Posted by jpluimers on 2020/11/24

Using abbreviations is always context sensitive, so when I first heard about CCP for Waze, I was thinking about some form of Central Counter Party clearing system, but the (wrongly titled page) at [WayBack] Free Driving Directions, Traffic Reports & GPS Navigation App by Waze as it is about

Connected Citizens Program

The Waze Way of free data exchange, yielding actionable insights and improved mobility on a local and global scale

It is a kind of clearing system after all, as it facilitates exchange, in this case of traffic related information.

But it is not really a Citizens Program, as individuals cannot apply: only organisations can.

Those organisations can obtain from or send information to Waze using various APIs, or do both.

I will try to apply as a individual or company to learn more about the Waze APIs involved.

–jeroen

Posted in DDD Domain Driven Development, Development, Software Development | Leave a Comment »

About Event Tracing – Windows applications | Microsoft Docs

Posted by jpluimers on 2020/11/24

On my list of things to look into: [WayBack] About Event Tracing – Windows applications | Microsoft Docs.

It is so much better than OutputDebugString!

Via Kent Morwath commenting at Never ever put OutpugDebugString in code that is meant to run on production systems « The Wiert Corner – irregular stream of stuff

–jeroen

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

Kristian Köhntopp had an interesting JOINs go when moving from monolithic to microservicecs (i.e. when customers and orders are in separate services)

Posted by jpluimers on 2020/11/19

https://twitter.com/isotopp/status/1270824610469208072

is a summary of:

[WayBack] Thread by @isotopp: Are you a Developer and understand (Micro-) Services? I am a database person and a bit simple, and I have a genuine Question: When moving to…

Are you a Developer and understand (Micro-) Services? I am a database person and a bit simple, and I have a genuine Question:

When moving to a services architecture, where do the JOINs go?

So you sell stuff, that is you have an orders table o, with an oid, which stores a customer id cid from a customers c table, and an article id aid, from an articles table and a count cnt.
customer 17 ordered 3 45’s:
? SELECT cnt
> FROM o JOIN c ON o.cid = c.cid
> AND o.aid = a.aid
> WHERE c.cid = 17;= 3
When moving to services, because you are multibillion dollar enterprise, your customers, orders and articles can no longer fit into a single database, and there are other reasons to have an OrderService, CustomerService and ArticleService.

You still want to ask something (OrderService?) about the number of 45’s that 17 ordered.

Who do you ask? What does this do to connect the dots? How do you do reporting (“Show me all top 10 articles by country, zipcode digit 1 by week over the last 52w”)?

Do you reimplement join algorithms by hand in application code? Are there supporting tools? Do you reimplement data warehousing aggregations, too?
If so, what tooling for reporting does exist, and how does that compare to eg existing tooling for data warehousing?

Some of the reactions on Twitter are below

–jeroen

Read the rest of this entry »

Posted in Database Development, Development, Software Development, Systems Architecture | Leave a Comment »

960 Grid System

Posted by jpluimers on 2020/11/19

Would this be the reason that so many web-sites still use less than half of my screen width?

The 960 Grid System is an effort to streamline web development workflow.

Source: [WayBack] 960 Grid System

Via: [WayBack] windows – What minimum screen size should I assume? – Stack Overflow (where in 2010 for some types of software you had to go for 640×480, many things were still 800×600, but 1024×768 for desktop users was the norm; on the one hand times have changed, but on the other hand not a lot).

Code: [WayBack] GitHub – nathansmith/960-Grid-System: The 960 Grid System is an effort to streamline web development workflow.

Related:

–jeroen

Posted in Development, Software Development, Usability, User Experience (ux), Web Development | Leave a Comment »

A bunch of Spring4D dependency injection container related questions

Posted by jpluimers on 2020/11/19

Since G+ is down, a lot of interesting questions have vanished.

Luckily I saved some by [WayBack] Jacek Laskowski – Google+ related to Spring4D and dependency injection:

[WayBack] Spring4D IoC and specific singleton… – Jacek Laskowski – Google+

First my Google Groups archival reminder:

  1. Rename from
  2. To
  3. Save that URL with Archive.is

Read the rest of this entry »

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

Checkout github pull requests locally · GitHub

Posted by jpluimers on 2020/11/18

Checkout github pull requests locally. GitHub Gist: instantly share code, notes, and snippets.

Source: [WayBack] Checkout github pull requests locally · GitHub

The trick is to add one more fetch line to the [remote "origin"] sections in your .git/config files, as in the gist below.

fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

Which reminds me I should read more about that the fetch syntax which is called RefSpec: [WayBack] Git – The Refspec

–jeroen

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, GitHub, Software Development, Source Code Management | Leave a Comment »

Do not make methods protected unless you want them to be visible as public

Posted by jpluimers on 2020/11/18

One of the protection levels in Delphi is protected. Originally meant for the class itself, that level is also visible to “friends”: anything in the same unit, for example:

unit BusinessLogicUnit;

interface

type
  TBusinessLogic = class(TObject)
  protected
     Procedure Foo();
     // ...
  public
     // ...
  end;

implementation

// ...

end.

You can even access them from outside that unit by using a trick like below.

Some people use the protected section so that unit tests can assess them using the below trick.

Do not do that!

It means anyone can use that trick, often doing more damage than good.

In this case, the trick was abused by a clever programmer that was relatively new to the code base. It resulted in unintended side effects.

unit HackUnit;

interface

implementation

uses
  BusinessLogicUnit;

type
  TBusinessLogicHack = class(TBusinessLogic);

procedure Hack;
var
  Instance: TBusinessLogicHack;
begin
  Instance := TBusinessLogicHack.Create();
  try
    Instance.Foo();
  finally
    Instance.Free();
  end;
end;

end.

Of course you can still access it like below.

It is slightly longer, but more importantly: much better shows the intent and how that intent is accomplished.

unit GoodUsageUnit;

interface

implementation

uses
  BusinessLogicUnit;

type
  TBusinessLogicDescendant = class(TBusinessLogic)
  public
    procedure Foo();
  end;

procedure TBusinessLogicDescendant.Foo();
begin
  inherited Foo();
  // ...
end;

procedure Usage;
var
  Instance: TBusinessLogicDescendant;
begin
  Instance := TBusinessLogicDescendant.Create();
  try
    Instance.Foo();
  finally
    Instance.Free();
  end;
end;

end.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 1 Comment »

The Delphi Geek: Using Generics to Manipulate Enumerated Types

Posted by jpluimers on 2020/11/18

Not that this is bad code, but there are no unit tests for them, and I have seen places in the wild that blindly use it without documenting where it came from and what tested alternatives might be: [WayBack] The Delphi Geek: Using Generics to Manipulate Enumerated Types

The unit itself is down (though there is still a copy on the WayBack machine).

The post itself mentions it is Spring4D-inspired, and since Spring4D already has quite an extensive [WayBack] TEnum<T> implementation covered by unit tests, so that is a logical place to do for.

I might actually document the migration table if I find time for it.

Here is a start so I will only have to insert the blanks

Function Replacement
class function Clip(const value: Integer): T;
class function Clip(const value: T): T;
class function Ensure(const value: Integer; const min, max: T): T;
class function Ensure(const value, min, max: T): T;
class function FromInt(const value: Integer): T;
class function Enum: RangeEnum; static;
class function GetValueOrDefault(const value: Integer): T;
class function IsValid(const value: Integer): Boolean;
class function IsValid(const value: T): Boolean;
class function Max: T; static;
class function Min: T; static;
class function ToInt(const value: T): Integer;
class function ToString(const value: T): string;

–jeroen

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

Delphi: `procedure RaiseAbstractError(const aClass: TClass; const aMethodName: string);`

Posted by jpluimers on 2020/11/17

Needs the System.SysConst unit:

procedure RaiseAbstractError(const aClass: TClass; const aMethodName: string);
begin
  // more explanatory than AbstractErrorProc();
  raise EAbstractError.CreateFmt('%s: method %s.%s', [SAbstractError, aClass.ClassName, aMethodName]);
end;

It uses a TClass typed parameter so you can call it from non-static class methods (using Self as parameter value) in addition to instance methods (using ClassType as parameter value).

–jeroen

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

FeaturesShim: using ShimGen for creating a shim to a program either console or GUI so you need only one bin directory

Posted by jpluimers on 2020/11/17

[WayBack] FeaturesShim is a cool Chocolatey feature that uses ShimGen.

This allows Chocolatey to take only one directory in your search PATH, with a lot of small files, that link to the much larger actual executable files.

ShimGen (like many other parts of Windows and some other parts of Chocolatey) is not open source, but the mechanism is documented.

More information:

–jeroen

Posted in .NET, Development, Power User, Software Development, Windows, Windows Development | Leave a Comment »