
I'm an enthusiastic Chilean software engineer in New Zeland. I mostly focus on the back-end of the systems. This is my site, Señor Developer, where I share my knowledge and experience.
Search for a command to run...

I'm an enthusiastic Chilean software engineer in New Zeland. I mostly focus on the back-end of the systems. This is my site, Señor Developer, where I share my knowledge and experience.
In this series, I will show you the S.O.L.I.D principle. They consist of five object-oriented design principles which guide developers in writing clean, maintainable and efficient code.
S.O.L.I.D Principles Series
Quilla Frontend Kit turns recurring API, authentication, and server-state concerns into composable TypeScript packages.

Quilla Backend Kit provides the foundations for structured TypeScript services while leaving the application architecture in your hands.

Practical constraints for preserving the framework’s boundaries, dependency direction, and readability as a test suite grows.

A tool-agnostic approach to separating test intent from UI mechanics as an automation suite grows.

In this article, we will go through the entire process of set up Visual Studio Code for debugging “Deno” programs using “V8 Inspector Protocol”. Step-by-step, we will be learning how to configure VSCode to debug a Deno project. If you don’t know Deno...

According to the Interface Segregation Principle (ISP), a client shouldn't be made to implement interfaces they don't utilise. Stated otherwise, a class shouldn't be made to rely on methods it doesn't employ. It is preferable to have smaller, more focused interfaces as opposed to large, monolithic ones.
Let's take the example of a band consisting of singers, drummers, and guitarists in the setting of musicians. We may design unique interfaces for every kind of musician rather than having a single Musician interface that has every technique conceivable for all kinds of musicians:

Let's demonstrate the Interface Segregation Principle in action:
interface IGuitarist {
playGuitar(): void;
}
interface IDrummer {
playDrums(): void;
}
interface ISinger {
sing(): void;
}
Now, each musician class can implement only the interface relevant to their role. For example:
class RockGuitarist implements IGuitarist {
playGuitar(): void {
console.log("Playing electric guitar in a rock band");
}
}
class JazzDrummer implements IDrummer {
playDrums(): void {
console.log("Playing jazz drum beats");
}
}
class PopSinger implements ISinger {
sing(): void {
console.log("Singing catchy pop melodies");
}
}
// Let's play music:
const popSinger = new PopSinger();
popSinger.sing()
const rockGuitarist = new RockGuitarist();
rockGuitarist.playGuitar();
const jazzDrummer = new JazzDrummer();
jazzDrummer.playDrums();
Our code is more flexible and maintainable when we adhere to the Interface Segregation Principle, which makes sure that each class only depends on the methods it requires.
See you in the next article of this series.