SOLID principles by example: Interface segregation

This post continues the analisys of the SOLID principles and it’s about the Interface Segregration Principle (ISP). Definition The interface-segregation principle (ISP) states that no client should be forced to depend on methods it does not use. The bad example Here we examine an interface that violates ISP: This interface states that a smart device…… Continue reading SOLID principles by example: Interface segregation

SOLID principles by examples: Liskov Substitution Principle

In this post we’re going to explore the third of the SOLID principles: the Liskov Substitution Principle (LSP). The most practical definition of this principle was written by Robert C. Martin in his book Agile Software Development, Principles, Patterns, and Practices. Subtypes must be substitutable for their base types. The concept was introduced by Barbara…… Continue reading SOLID principles by examples: Liskov Substitution Principle

SOLID principles by examples: open/closed

This post continues the analisys of the SOLID principles started some blog posts ago. This is the turn for the Open Closed Priciple (OCP). The definition An object/entity should be open for extension but closed for modification. What we are basically talking about is to design our modules, classes and functions in a way that…… Continue reading SOLID principles by examples: open/closed

SOLID principles by examples: single responsability

This blog post will explain with simple examples the Singe Responsabily Principle of SOLID agiles principles to better understand how we can improve our daily coding activites. In future post I’ll cover the other four priciples. The Definition A class should have only one reason to change. Defined by Robert C. Martin in his book…… Continue reading SOLID principles by examples: single responsability

SOLID principles by examples: introduction

SOLID is a common acronym in the software development world. It’s useful to remeber five best practices to design classes in a object oriented language. It means: InitialStands forConcept SRP Single Responsability Principle A class should have only a single responsability. OCP Open Closed Principle Software entities should be open for extension but closed for…… Continue reading SOLID principles by examples: introduction

Gold-plating

Qualche settimana fa non conoscevo questo termine. Avete presente quel momento in cui si sta sviluppando qualcosa e il pensiero comincia a prendere la tangente: “Ma se succedesse anche questo allora c’è bisogno di quest’altro. A questo punto all’ora potrei implementare questa funzione!”. Oppure: “Aggiungiamo anche questa funzione perché magari può succedere che…”. Quando sentiamo…… Continue reading Gold-plating