PHPNews

Tell, don't ask

When I started programming, I thought that object oriented programming was about using classes and inheritance. It took me a few years to realize that there was much more to it. The following example is taken from Symfony’s documentation. public function index() { // you can fetch the EntityManager via...

Continue reading »

Written by Patrick Louys - - Aggregated on Saturday May 26, 2018


Become a better developer in 2018

Do you have any programming related New Year’s resolutions? A lot of people don’t follow through with their resolutions. But don’t let that discourage you. When you make resolutions, you are much more likely to achieve your goals (10x more). I wrote this post to show you how you can...

Continue reading »

Written by Patrick Louys - - Aggregated on Wednesday December 27, 2017


Simplify Your Code With Query Objects

Did you ever have problems with repository classes that just kept on growing over the years, with no end in sight? This is a problem that I have encountered in multiple projects and companies. Usually the repository starts out small, but then more and more methods are added over time....

Continue reading »

Written by Patrick Louys - - Aggregated on Tuesday November 28, 2017


Value Objects Explained

In “The Importance of Bounded Contexts” I talked about one of the big lessons that I learned from domain driven design (DDD). But separating code by bounded context was only one of the things that I learned and improved my code at the same time. Today I want to talk...

Continue reading »

Written by Patrick Louys - - Aggregated on Sunday June 4, 2017


The Importance of Bounded Contexts

In the last six months I immersed myself in domain driven design (DDD). I read the green (DDD Distilled) and red (Implementing DDD) books by Vaughn Vernon, read all the blogposts and watched all the talks that I could find. I was already used to programming with entities and repositories,...

Continue reading »

Written by Patrick Louys - - Aggregated on Wednesday April 26, 2017


A DateTime WTF moment for me

I am working on a small webapp to manage my BJJ academy and today I noticed something weird on my dashboard. I have a small widget that displays the number of signups for each of the last 3 months like below. So what happened? To get the last 3 months,...

Continue reading »

Written by Patrick Louys - - Aggregated on Thursday March 30, 2017


The Open/Closed Principle

I am a big proponent of the SOLID principles. But one of the principles - the open/closed principle - is often misunderstood. software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification This is how Bertrand Meyer stated it first in his book “Object-Oriented Software.…

Continue reading »

Written by Patrick Louys - - Aggregated on Sunday December 11, 2016