PHPNews

Dividing responsibilities - Part 2

This is another excerpt from my latest book, which is currently part of Manning's Early Access Program. Take 37% off Object Design Style Guide by entering fccnoback into the discount code box at checkout at manning.com. Make sure to read part 1 first. Create read models directly from their data source …

Continue reading »

Written by Matthias Noback - - Aggregated on Monday July 22, 2019


Dividing responsibilities - Part 1

I'm happy to share with you an excerpt of my latest book, which is currently part of Manning's Early Access Program. Take 37% off Object Design Style Guide by entering fccnoback into the discount code box at checkout at manning.com. Chapter 7: Dividing responsibilities We've looked at how objects can be used …

Continue reading »

Written by Matthias Noback - - Aggregated on Thursday July 18, 2019


You may not need a query bus

"Can you make a query bus with SimpleBus ?" The question has been asked many times. I've always said no. Basically, because I didn't build in the option to return anything from a command handler. So a handler could never become a query handler, since a query will of course have to return something. I've always …

Continue reading »

Written by Matthias Noback - - Aggregated on Thursday June 27, 2019


Newcrafts 2019 Day 1

This week I attended and spoke at the Newcrafts conference in Paris. The following is a mix of notes and personal observations I wanted to share, centered around some of the talks I saw there. Romeu Romera: Bourdieu's Social theory and our work in tech I had never attended a talk by Romeu before. I really …

Continue reading »

Written by Matthias Noback - - Aggregated on Friday May 17, 2019


Hand-written service containers

You say "convention over configuration;" I hear "ambient information stuck in someone's head." You say "configuration over hardcoding;" I hear "information in a different language that must be parsed, can be malformed, or not exist." — Paul Snively (@paul_snively) March 2, 2019 Dependency injection is very …

Continue reading »

Written by Matthias Noback - - Aggregated on Monday March 4, 2019


DDD Europe notes - Day 2

Cyrille Martraire: Domain modeling towards First Principles This was a talk from the first day, but it required some more processing before writing about it. Cyrille is one of my favorite speakers. He's fast, funny and brings a lot of interesting topics to the table. So many that it's sometimes hard to keep …

Continue reading »

Written by Matthias Noback - - Aggregated on Friday February 1, 2019


DDD Europe notes - Day 1

Eric Evans: Keynote ("Language in Context") Starting out with the basics (words have meaning within a context; when we make the boundary of this context explicit we end up with a bounded context ), Eric discussed two main topics: the Big Ball of Mud , and bounded contexts in the context (no pun intended) of …

Continue reading »

Written by Matthias Noback - - Aggregated on Thursday January 31, 2019


Principles of Package Design, 2nd edition

All of a sudden it became book-writing season. It began in August when I started revising my second book, "Principles of Package Design". Apress had contacted me about adopting it, and they didn't want to change a lot about it. However, the book was from 2015 and although I had aimed for it to be "timeless", some …

Continue reading »

Written by Matthias Noback - - Aggregated on Monday December 17, 2018


Assertions and assertion libraries

When you're looking at a function (an actual function or a method), you can usually identify several blocks of code in there. There are pre-conditions , there's the function body , and there may be post-conditions . The pre-conditions are there to verify that the function can safely proceed to do its real job . …

Continue reading »

Written by Matthias Noback - - Aggregated on Tuesday September 18, 2018


Final classes by default, why?

I recently wrote about when to add an interface to a class . After explaining good reasons for adding an interface, I claim that if none of those reasons apply in your situation, you should just use a class and declare it "final". PHP 5 introduces the final keyword, which prevents child classes from overridin…

Continue reading »

Written by Matthias Noback - - Aggregated on Tuesday September 11, 2018


Reusing domain code

Last week I wrote about when to add an interface to a class . The article finishes with the claim that classes from the application's domain don't usually need an interface. The reason is that domain code isn't going to be swapped out with something else. This code is the result of careful modelling work that's done …

Continue reading »

Written by Matthias Noback - - Aggregated on Tuesday September 4, 2018


When to add an interface to a class

I'm currently revising my book "Principles of Package Design" . It covers lots of design principles, like the SOLID principles and the lesser known Package (or Component) Design Principles. When discussing these principles in the book, I regularly encourage the reader to add more interfaces to their classes, to make …

Continue reading »

Written by Matthias Noback - - Aggregated on Tuesday August 28, 2018


More code comments

Recently I read a comment on Twitter by Nikola Poša: I guess the discussion on my thread is going in the wrong direction because I left out a crucial hashtag: #NoCommentsInCode - avoid comments in code, write descriptive classes, methods, variables. https://t.co/MuHoOFXCvV — Nikola Poša (@nikolaposa) July 13, …

Continue reading »

Written by Matthias Noback - - Aggregated on Monday August 13, 2018


Objects should be constructed in one go

Consider the following rule: When you create an object, it should be complete, consistent and valid in one go. It is derived from the more general principle that it should not be possible for an object to exist in an inconsistent state. I think this is a very important rule, one that will gradually lead …

Continue reading »

Written by Matthias Noback - - Aggregated on Tuesday July 17, 2018