← CodeClarityLab Home
Browse by Category
+ added · updated 7d
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Domain Model Pattern
An object model of the domain that incorporates both behaviour and data — entities with methods expressing domain operations rather than just data containers.
2mo ago quality advanced
Interpreter Pattern
A grammar represented as a class hierarchy — used for search query parsers, expression evaluators, and rule engines.
2mo ago quality advanced
ABC Metric (Assignments, Branches, Conditions) PHP 5.0+
Code complexity metric using vector magnitude of assignments, branches, and conditions — more expressive than line count.
2mo ago quality advanced
Diagram: Anemic Domain Model (Anti-Pattern) Anemic Domain Model (Anti-Pattern)
Domain objects with only data (getters/setters) and no behaviour — business logic scattered across service classes.
2mo ago quality advanced
Design by Contract
Methods define formal preconditions (what callers must guarantee), postconditions (what the method guarantees), and invariants (what's always true).
2mo ago quality advanced
Flyweight Pattern
A structural pattern that shares common state between many objects rather than storing it in each instance — dramatically reducing memory for large numbers of similar objects.
2mo ago quality advanced
Halstead Maintainability Index
A composite metric (0–100) combining lines of code, cyclomatic complexity, and Halstead volume to estimate maintainability.
2mo ago quality advanced
Object Calisthenics
Nine strict OO coding rules by Jeff Bay that, if followed, force good object-oriented design habits.
2mo ago quality advanced
Open/Closed Principle — PHP Examples
Software entities should be open for extension but closed for modification — add new behaviour without editing existing, tested code.
2mo ago quality advanced
Types of Cohesion
Cohesion grades from Coincidental (worst — random grouping) to Functional (best — single well-defined purpose), guiding module design decisions.
2mo ago quality advanced
Types of Coupling
Coupling grades from Content (worst — direct internal access) to Message (best — pure interface communication), guiding decoupling decisions.
2mo ago quality advanced
Unit of Work
A pattern that tracks all changes made to domain objects during a business transaction and coordinates writing them out as a single atomic database operation.
2mo ago quality advanced
Visitor Pattern PHP 5.0+
A behavioural pattern that separates an algorithm from the objects it operates on — adding new operations to a class hierarchy without modifying those classes.
2mo ago quality advanced
✓ schema.org compliant