Defining the building blocks of Domain Driven Design

An important part of the beauty of Domain Driven Design is the fact that we have a language to describe certain concepts and components within our application. Terms like Aggregate Root, Value Object and Entity have concrete meanings that describe how our applications are formed. Whilst these terms form part of the structure of Domain […]

Continue reading...

How to create an Active Record style PHP SDK Part 10

Making requests and receiving responses from a third-party API is pretty easy. By default most APIs follow the conventions of REST and use a common format of either JSON or XML to send and receive data. However once we have accepted a response from the API, we need a way of parsing the payload into […]

Continue reading...

What are the benefits of using Repositories?

So far in this series of blog posts we’ve looked at building and working with Repositories a couple of times. A Repository is basically a layer that sits between your project’s domain and the database. Whilst I think The Repository Pattern is becoming pretty well known, it seems to me that there is still confusion […]

Continue reading...

How to create an Active Record style PHP SDK Part 9

An API is an interface to an external system. By using an API we can interact with a third-party system regardless of how the internals of the third-party operate. In order to transfer data from one system to another through an API we need a common format. Typically data is transferred between systems as either […]

Continue reading...

The User Entity and The Ubiquitous Language

Over the last couple of weeks we’ve looked at using the power of Object Oriented Programming to encapsulate the business rules of our application. By defining Value Objects such as Email, Username and Password we can ensure that the objects we are working within our application follow the explicit rules of the business. Next we […]

Continue reading...

How to create an Active Record style PHP SDK Part 8

Last week we looked at setting up the foundation of being able to query the CapsuleCRM API. First we separated the querying functionality into it’s own directory and split each querying action into it’s own trait. Next we created the convention of inferring the API endpoint, but also allowing local configuration to override this convention […]

Continue reading...

Implementing The Specification Pattern

Last week we looked at encapsulating business logic within Value Objects. By using the characteristics of Object Oriented Programming we can maintain the integrity of our business rules within the harmony of using plain old PHP objects. One of the rules that we needed to implement last week was the uniqueness of a user’s username […]

Continue reading...

How to create an Active Record style PHP SDK Part 7

One of the most important aspects of creating an API SDK is the ability to effectively query the underlying API in order to allow the developer to retrieve resources. So far in this series we’ve looked at setting up the HTTP Client using Guzzle and then creating the abstract model that will form the foundation […]

Continue reading...

Encapsulating your application’s business rules

Over the last couple of week’s we’ve looked quite extensively into integrating Doctrine 2 into a Laravel project as well as the unique characteristics and functionality Doctrine 2 offers us as the ORM layer to our applications. Doctrine 2 is an implementation of The Data Mapper pattern. The Data Mapper pattern promotes the separation of […]

Continue reading...

How to create an Active Record style PHP SDK Part 6

Over the last couple of weeks we’ve looked at setting up the foundation of creating an Active Record style PHP SDK. One of the beautiful things about the Active Record pattern is the very intuitive and easy to use interface that is presented to the developer. The Active Record pattern presents entities and their storage […]

Continue reading...

Supported by