Would you agree this is the definition of a PHP framework?

Tony thinks separation of concerns and SRP are one and the same. So, because his framework follows MVC, thus obeying SoC, all of it then automatically obeys SRP too.

The contradiction he accuses Bob of making comes from his clear misunderstanding of the two concepts, which differ only in scope basically. SoC’s scope is at a higher framework/ application level. Like…separation of concerns between areas of the framework and application to split them up in logical parts, so they are more modular, reusable and easier to change.

SRP’s scope is at the lower class level. It describes how classes should be formed, so they are also more modular, reusable and easier to change. The goals of both concepts are the same, however, you can’t always say you have successfully complied with SoC and it directly means you have properly done SRP too.

If you see the two concepts like that, then everything Bob has said makes perfect sense and we are back to Tony’s 9000 line class breaking SRP.

Scott

1 Like