Blog

What Is Code Rot?

What Is Code Rot?

Code rot is a form of Technical debt, which builds up over time. It is the process where the quality of the code deteriorates.

VIEW ARTICLE

Uncle Bob

Uncle Bob

Recommended informative free YouTube videos from Uncle Bob.

VIEW ARTICLE

Composition Over Inheritance

Composition Over Inheritance

Inheritance isn’t all bad, but in some instances it doesn’t make sense to use it.

VIEW ARTICLE

SOLID Principles Explained

SOLID Principles Explained

Attempting to write code which satisfies the current requirements and future requirements should be the goal.

VIEW ARTICLE

SQL Optimisation

SQL Optimisation

More often than not the initial database design works fine at the beginning, however as time goes on, changes are made and the data grows. Bottlenecks appear, you pick up a bunch of slow queries or you run out of storage.

VIEW ARTICLE

Writing Readable PHP - general tips and advice

Writing Readable PHP - general tips and advice

Tips and hints around writing readable PHP

VIEW ARTICLE

Writing Readable PHP - being expressive

Writing Readable PHP - being expressive

Being expressive when writing code makes it easier for people to understand your code and shows you care about the next developer who comes along.

VIEW ARTICLE

Lambda Functions

Lambda Functions

A lambda function is an anonymous PHP function that can be stored in a variable and passed as an argument to other functions or methods. A closure is a lambda function that is aware of its surrounding context.

VIEW ARTICLE

Eloquent Performance

Eloquent Performance

Some hints and tips to help improve performance of your Laravel application

VIEW ARTICLE

Eloquent - Calculating totals using conditional aggregates

Eloquent - Calculating totals using conditional aggregates

How to correctly calculate totals in Eloquent using conditional aggregates

VIEW ARTICLE

Testing Your User Interface

Testing Your User Interface

How to test your user interface effectively (tips included)

VIEW ARTICLE

Chain Of Responsibility Pattern

Chain Of Responsibility Pattern

To build a chain of objects to handle a call in sequential order. If one object cannot handle a call, it delegates the call to the next in the chain and so forth.

VIEW ARTICLE

Command Pattern

Command Pattern

To encapsulate invocation and decoupling.

VIEW ARTICLE

Interpreter Pattern

Interpreter Pattern

For a given language, it defines the representation of its grammar as "No Terminal Expression" and "Terminal Expression", as well as an interpreter for the sentences of that language.

VIEW ARTICLE

Iterator Pattern

Iterator Pattern

To make an object iterable and to make it appear like a collection of objects.

VIEW ARTICLE

Mediator Pattern

Mediator Pattern

This pattern provides an easy way to decouple many components working together. It is a good alternative to Observer IF you have a "central intelligence", like a controller (but not in the sense of the MVC).

VIEW ARTICLE

Memento Pattern

Memento Pattern

It provides the ability to restore an object to it's previous state (undo via rollback) or to gain access to state of the object, without revealing it's implementation (i.e., the object is not required to have a function to return the current state).

VIEW ARTICLE

Null Object Pattern

Null Object Pattern

NullObject is not a GoF design pattern but a schema which appears frequently enough to be considered a pattern

VIEW ARTICLE

Observer Pattern

Observer Pattern

Usage of this pattern allows class functionality to be dynamically extended in runtime, helping to prevent code rot and ensuring functionality is decoupled.

VIEW ARTICLE

Specification Pattern

Specification Pattern

Builds a clear specification of business rules, where objects can be checked against.

VIEW ARTICLE

State Pattern

State Pattern

Encapsulate varying behaviour for the same routine based on an object's state. This can be a cleaner way for an object to change its behaviour at runtime without resorting to large monolithic conditional statements.

VIEW ARTICLE

Strategy Pattern

Strategy Pattern

To separate strategies and to enable fast switching between them. Also this pattern is a good alternative to inheritance (instead of having an abstract class that is extended).

VIEW ARTICLE

Visitor Pattern

Visitor Pattern

The Visitor Pattern lets you outsource operations on objects to other objects. The main reason to do this is to keep a separation of concerns. But classes have to define a contract to allow visitors.

VIEW ARTICLE

Abstract Factory Pattern

Abstract Factory Pattern

To create series of related or dependent objects without specifying their concrete classes

VIEW ARTICLE

Builder Pattern

Builder Pattern

Builder is an interface that build parts of a complex object.

VIEW ARTICLE

Factory Method Pattern

Factory Method Pattern

Factory method allows subclassing to implement different ways to create objects. It depends on abstractions, not concrete classes.

VIEW ARTICLE

Pool Pattern

Pool Pattern

The object pool pattern is a software creational design pattern that uses a set of initialised objects kept ready to use – a "pool" – rather than allocating and destroying them on demand

VIEW ARTICLE

Prototype Pattern

Prototype Pattern

To avoid the cost of creating objects the standard way (new Foo()) and instead create a prototype and clone it.

VIEW ARTICLE

Simple Factory Pattern

Simple Factory Pattern

SimpleFactory is a simple factory pattern. It differs from the static factory because it is not static

VIEW ARTICLE

Singleton Pattern

Singleton Pattern

To have only one instance of this object in the application that will handle all calls.

VIEW ARTICLE

Static Factory Pattern

Static Factory Pattern

Similar to the AbstractFactory, this pattern is used to create series of related or dependent objects.

VIEW ARTICLE

Adapter Pattern

Adapter Pattern

To translate one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces by providing its interface to clients while using the original interface.

VIEW ARTICLE

Bridge Pattern

Bridge Pattern

Decouple an abstraction from its implementation so that the two can vary independently.

VIEW ARTICLE

Composite Pattern

Composite Pattern

To treat a group of objects the same way as a single instance of the object.

VIEW ARTICLE

Data Mapper Pattern

Data Mapper Pattern

A Data Access Layer that performs bidirectional transfer of data between a persistent data store (often a relational database) and an in memory data representation (the domain layer).

VIEW ARTICLE

Decorator Pattern

Decorator Pattern

To dynamically add new functionality to class instances.

VIEW ARTICLE

Dependency Injection

Dependency Injection

To implement a loosely coupled architecture in order to get better testable, maintainable and extendable code.

VIEW ARTICLE

Facade Pattern

Facade Pattern

Grouping code together to reduce complexity; making it simple and easier to understand.

VIEW ARTICLE

Fluent Interfaces

Fluent Interfaces

To write code that is easy readable just like sentences in a natural language (like English).

VIEW ARTICLE

Flyweight Pattern

Flyweight Pattern

To minimise memory usage, a Flyweight shares as much as possible memory with similar objects. It is needed when a large amount of objects is used that don't differ much in state.

VIEW ARTICLE

Proxy Pattern

Proxy Pattern

Create an interface to anything that is expensive or impossible to duplicate.

VIEW ARTICLE

Registry Pattern

Registry Pattern

To implement a central storage for objects often used throughout the application, is typically implemented using an abstract class with only static methods (or using the Singleton pattern).

VIEW ARTICLE

Design Patterns - Overview

Design Patterns - Overview

A design pattern is a general, reusable solution to common occurring problems within a given context in software engineering.

VIEW ARTICLE

Hexagonal Architecture

Hexagonal Architecture

Also known as the Ports and Adapters architecture. This architecture clearly separates core logic from the input and output infrastructure, dividing the system into loosely-coupled interchangeable components. Throughout the years, it grew in popularity to become one of the most widely recognised types of software architecture.

VIEW ARTICLE

Encapsulate What Varies

Encapsulate What Varies

Identify aspects of your application that vary and separate from what stays the same.

VIEW ARTICLE