Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ewan Valentine:
Designing Domain Specific Language
Sep 25, 2015 @ 11:56:54

In a post to his site Ewan Valentine looks at some considerations to think about when creating a domain specific language in your applications. This kind of language helps define common terms, conventions and practices for developers to follow in their code.

When you spin up a framework such as Laravel, Symfony etc. The first thing you'll notice, is that they have their own 'feel'. I often joke that Symfony2 is like Java and Laravel is like Ruby.

But what gives an application or a framework a 'feel'? Domain specific language or 'DSL'. Domain specific language is almost like a syntax or a language specific to your application and ecosystem. DSL is what makes your applications code unique and more usable.

He gives a specific example of a Laravel application he was creating and how he wanted the interface to function, transforming the result of a find() into a JSON response. He shows how it could actually be done but that introduces more maintenance and more code to cover. Instead he worked backwards into the domain context the request was operating in and found an ideal injection point for transformation that would keep it out of the controller action itself.

So, to design usable domain specific syntax, start at the front. In other words the part you'll be writing the most, and then work backwards to abstract the logic and make it actually work.
tagged: domain specific language design laravel injection transform json

Link: http://ewanvalentine.io/designing-domain-specific-language/

S.O.L.I.D: The First 5 Principles of Object Oriented Design
Mar 19, 2015 @ 10:30:47

On Scotch.io today they've posted a tutorial about SOLID, the "first five principles of object oriented design". SOLID is an acronym made from the first letter of several principles that can help make your OOP code well-architected and easier to test.

S.O.L.I.D is an acronym for the first five object-oriented design(OOD) principles by Robert C. Martin, popularly known as Uncle Bob. These principles, when combined together, make it easy for a programmer to develop software that are easy to maintain and extend. They also make it easy for developers to avoid code smells, easily refactor code, and are also a part of the agile or adaptive software development. Note: this is just a simple “welcome to S.O.L.I.D” article, it simply sheds light on what S.O.L.I.D is.

They start with a basic overview of what the letters in SOLID stand for and then work through each, providing basic code examples to help make the point clearer.

tagged: solid oop design principles introduction objectoriented

Link: https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design

Full Stack Radio:
Episode 3: Ruby, PHP, OO design, testing & other crap with Matt Machuga
Nov 17, 2014 @ 12:15:57

The Full Stack Radio podcast has released their latest episode today - Episode #3: Ruby, PHP, object oriented design, testing and other crap with Matt Machuga, with host Adam Wathan.

In this episode, Adam talks with Matt Machuga of Think Through Math about being a Rubyist who still writes PHP and the differences between writing PHP like a Rubyist vs. writing PHP like a Java developer. They also talk about common struggles when learning new things, and trying to remain pragmatic while still pushing the boundaries of what you know.

Links in the show notes include Matt's personal website, DHH on dependency injection and a book on Domain Driven Design. You can check out this episode either using the downloading the mp3. If you enjoy the episode, be sure to subscribe to their feed.

tagged: fullstackradio podcast ep3 ruby objectoriented design testing mattmachuga

Link: http://fullstackradio.com/episodes/3/

Matthias Noback:
Packages: the case for clones
Nov 17, 2014 @ 11:55:21

In a new post to his site Mattias Noback makes a case for clones (in response to this post from Phil Sturgeon). In it he defends the creation of "clones" of tools, either slightly different version of pre-existing PHP packages or the functionality from a package in another language.

There is this ongoing discussion in the PHP community (and I guess in every software-related community) about reinventing wheels. A refreshing angle in this debate came from an article by Phil Sturgeon pointing to the high number of "duplicate" packages available on Packagist. I agree with Phil. [...] It doesn't make sense to do the same thing over and over again. At least I personally don't try to make this mistake. If I want to write code that "already exists", at least I don't publish it on Packagist. However, recently I got myself into the business of "recreating stuff" myself.

He talks some about one of his own projects (SumpleBus) and how, despite it possibly being a clone of other packages, it has slightly different goals than other tools, making it a different tool, not just a straight up clone. He also covers some of the package design principles he suggests in his book and how they can help to make an isolated package better. He also points out how recent PHP-FIG efforts to define common interfaces and structures can help reduce this kind of package duplication as well by reducing the possible implementations of any given process.

tagged: package reinvent wheel opinion duplication design principles phpfig clone

Link: http://php-and-symfony.matthiasnoback.nl/2014/11/packages-the-case-for-clones/

Anthony Ferrara:
Foundations Of OO Design
Oct 30, 2014 @ 09:36:24

In his newest post Anthony Ferrara looks at some of the things he calls the foundations of object-oriented design, as set of three things (and principles) to keep in mind when working on OOP applications.

It's quite easy to mix up terminology and talk about making "easy" systems and "simple" ones. But in reality, they are completely different measures, and how we design and architect systems will depend strongly on our goals. By differentiating Simple from Easy, Complex from Hard, we can start to talk about the tradeoffs that designs can give us. And we can then start making better designs.

He starts with the "simple vs easy" concept and how sometimes making the two meet can be difficult. He includes an example of interdependent interfaces and how they add complexity (and, in turn, make them less easy to use). He also talks about accidental versus essential complexity and how, sometimes, "accidental" isn't always a bad thing. Finally, he wraps it up with a few principles to remember in your development including recommendations to reduce (accidental) complexity and keeping the target developers in mind, making it easiest for them to use.

tagged: foundation oop objectoriented design complex simple developer opinion

Link: http://blog.ircmaxell.com/2014/10/foundations-of-oo-design.html

Mathias Verraes:
DRY is about Knowledge
Aug 04, 2014 @ 10:51:50

In this new post to his site Mathias Verraes approaches the concept of the DRY principle (Don't Repeat Yourself) as being more about knowledge. He includes two "real world" examples where the business rules can change around you.

“Don’t Repeat Yourself” was never about code. It’s about knowledge. It’s about cohesion. If two pieces of code represent the exact same knowledge, they will always change together. Having to change them both is risky: you might forget one of them. On the other hand, if two identical pieces of code represent different knowledge, they will change independently. De-duplicating them introduces risk, because changing the knowledge for one object, might accidentally change it for the other object.

In his examples, he shows how hard-coded rules (like "a product container can only contain 3 products") could just be around certain needs, not the entire range of requests. He covers some of the principles of Domain-Driven Design and how they apply here, pointing out that changing rules in one part of the application can have an effect on other parts depending on it.

tagged: dry dontrepeatyourself principle knowledge domaindriven design business goal

Link: http://verraes.net/2014/08/dry-is-about-knowledge/

Three Devs & A Maybe Podcast:
Designing for the Web with Kris Jeary
Jul 08, 2014 @ 09:45:45

The Three Devs & A Maybe podcast has posted their latest episode (#32) with guest Kris Jeary to discuss "all things design" in web development.

This week we are lucky to have Kris Jeary on the show to discuss all things design. Starting off with how he got introduced to the world of web design, we move on to discuss the process he uses to create websites. We then touch upon where he gets inspiration from, and how the emergence of responsive and SPA ideologies has changed the way we think about the web. Finally, we wrap up the show with some good advice to anyone looking into getting into web design.

The show includes mentions of cron expressions in PHP, Modern.IE and CodeKit. You can listen to this latest episode either by downloading the mp3 directly or using the in-page player. If you like what you hear, consider subscribing to their feed too.

tagged: threedevsandamaybe podcast ep32 krisjeary design web

Link: http://threedevsandamaybe.com/posts/designing-for-the-web-with-kris-jeary/

Gonzalo Ayuso:
Talk about SOLID and Symfony at the deSymfony 2014 conference.
Jun 03, 2014 @ 09:23:21

Gonzalo Ayuso has posted a wrapup and the slides from his SOLID presentation at this year's deSymfony conference recently held in Barcelona, Spain.

Last saturday I attended to the deSymfony conference in Barcelona. A great opportunity to meet again with the PHP and Symfony community in Spain. This year the conference accepted my talk about SOLID and Symfony. Here you can see the slides of the talk (slides in spanish). [...] The conference was perfect. Barcelona is an incredible city and the conference place (10 minutes walking from the Sagrada Familia), was incredible too. Great talks. But the best, as always, the coffe breaks with the conversations with the Symfony and PHP community from Valencia, Zaragoza, Madrid, Barcelona, ...

His talk (in Spanish) covers some of the basics around the SOLID design principles including definitions of each piece and brief code snippets to illustrate. If you're interested in a bit more detail around the SOLID principles in PHP, check out the first four parts of a series over on NetTuts.com for each principle: Single Responsibility, Open/Closed, Liskov Substitution & Interface Segregation and Dependency Inversion principles.

tagged: solid design principles desymfony14 conference barcelona spain

Link: http://gonzalo123.com/2014/06/01/talk-about-solid-and-symfony-at-the-desymfony-2014-conference/

Mathias Verraes:
Why Domain-Driven Design Matters
May 21, 2014 @ 09:06:36

Mathias Verraes has a new post to his site sharing a set of slides from his presentation on why domain driven design matters in software development projects.

In the software industry, the life expectancy of ideas, methodologies, and technologies, is extremely short. And yet, after ten years, Domain-Driven Design is still growing bigger. [...] In this session, we’ll discuss what DDD is: from design patterns and modelling techniques, to the more philosophical ideas about how we deal with complexity. We explore why it has made such a profound impact, and how to decide whether it’s right for your project. We’ll have lots of room for open discussion, to make sure all your questions are answered.

It was presented at Akamon in Barcelona, Spain and the post includes his full set of slides from Speakerdeck.

tagged: presentation domaindriven design slides akamon

Link: http://verraes.net/2014/05/why-domain-driven-design-matters/

SitePoint PHP Blog:
Can Great Apps Be Written in PHP - An Interview Series
Apr 15, 2014 @ 13:05:34

Matthew Setter has started off a series of posts on the SitePoint PHP blog with the first post interviewing community members to answer one main question, "can great apps be written in PHP?"

I read an old post, circa 2010, on the MailChimp blog a little while ago, about their experience using PHP. It struck a chord with me, because the sentiments they shared I’ve felt myself, and heard echoed many times over the years. [...] Despite its successes, or people’s successes with it (a la Facebook, MailChimp, Hailo, Google, and others), it’s inferred we should use languages which had their foundations as pure languages; not ones which came to be a language, as PHP evolved into over time.

He references some of the other comments in the Mailchimp article about their experience with the language along with mentions of a few others. He wonders if these negative comments are true and, to get some answers, searches out other developers and their opinions. In this first interview he talks with Bobby Deveaux about his background in the language, what he'd like to see added and more.

tagged: application opinion mailchimp design language interview bobbydeveaux

Link: http://www.sitepoint.com/can-great-apps-written-php-interview-series