Dependency Inversion Principle

Dependency Inversion Principle

Firstly, what is the Dependency Inversion Principle?Definition: One should depend upon abstractions and not concrete instances. Typically in a software application, high level components need to depend on lower level components. If the low level components are ‘hard-coded’ into the high level components this causes two problems. 1. Testability The first problem is testability. It …

Dependency Inversion Principle Read More »

Interface Segregation Principle

Interface Segregation Principle

What is the Interface Segregation Principle? Definition: Many client-specific interfaces are better than one general-purpose interface. This principle is fairly straightforward. It is really just saying to keep your interfaces to a specific role, keep them small and concise. Reason: This enables code concrete classes not to have to implement every single method regardless of …

Interface Segregation Principle Read More »

Liskov substitution principle

Firstly, what is the Liskov substitution principle? Definition: Objects in an application should be replaceable with instances of their subtypes without altering the correctness of that program. To understand the Liskov substitution principle is useful to understand the concepts of Contravariance and Covariance. Contravariance Contravariance is the conversion of a class from its sub class …

Liskov substitution principle Read More »

Single Responsibility Principle

Firstly, what is the Single Responsibility Principle? Definition: An object should have a single responsibility. In practice, to adhere to this principle, an object is a class and that class’s functionality is grouped around a single idea or unit of responsibility. Robert C Martin defined responsibility as a reason to change. This means that a …

Single Responsibility Principle Read More »

Office Politics

Over the years I have found a commonality in the way developers think, which is fundamentally different than non-technical managers. This difference has often perplexed me and I have often wondered exactly what the nature of this difference is. It usually manifests itself in the form of developers thinking they are in some way better …

Office Politics Read More »