Why shared libraries between microservices are bad? [closed]

The evils of too much coupling between services are far worse than the problems caused by code duplication The author is very unspecific when he uses the generic word “coupling”. I would agree with certain types of coupling being a strict no-no (like sharing databases or using internal interfaces). However the use of common libraries … Read more

Implementing TypeScript interface with bare function signature plus other fields

A class cannot implement everything that is available in a typescript interface. Two prime examples are callable signatures and index operations e.g. : Implement an indexible interface The reason is that an interface is primarily designed to describe anything that JavaScript objects can do. Therefore it needs to be really robust. A TypeScript class however … Read more

Extend interface defined in .d.ts file

// How to extend Validator interface adding isArray() method?? You cannot do this in a file that is a module (some guidance here) and your file is a module because you have import expressValidator. Instead create a extendedValidator.d.ts and add the new stuff for TypeScript’s engine: declare module ExpressValidator { export interface Validator { isArray: … Read more

Usage of interface in Go

The idea behind go interfaces is duck typing. Which simply translates into: If you look like a duck and quack like a duck then you are a duck. Meaning that if your object implements all duck’s features then there should be no problem using it as a duck. Here is an example: package main import … Read more