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

Excuse me but SRP and SoC most certainly ARE the same. In Uncle Bob’s article http://blog.8thlight.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html he says the following:

Here he is definitely saying that “separation of responsibilities” is EXACTLY the same as “separation of concerns”

Again, you’re drawing an erroneous conclusion from something which doesn’t back up your point at all. More out of context searching between the lines trying to retain the last little grip of a point.

Why should I need more than three? The MVC pattern only mentions three, so why should I need more than that?

Actually I do have more than three. I have split the Model into two so that business rules and database access are handled in separate classes. In this way my framework implements both the 3 Tier Architecture and the MVC design pattern.

@tony_marston404

Serious question: What is it you’re trying to achieve here?

So far you’ve demonstrated that you disagree with everyone else in the world about every single topic (Coupling, Encapsulation, SRP) and you use wikipeida as a source, which is a bad idea by itself. You don’t understand what peer review is, you don’t know how to find a primary source, you continually take people out of context and spin what they say… my question is: Why? Why are you trying to prove here? All you’ve proven so far is that you have very little understanding of fundamental programming concepts and the academic sphere where the terms you so casually abuse come from. You rarely name a primary source and when you do you take one line and spin it. Please clarify: What is it you’re trying to achieve by coming here and claiming you know more than Academics and programmers from Google, Microsoft and Apple?

edit: you might like this:

The answer sums up your thought process quite well.

So what? That doesn’t change the definition of a framework. You’re free to argue your approach is better, but it doesn’t change the meaning of words.

1 Like

Don’t be silly. The word “component” means “constituent part” and can also be referred to as “module”. A module can also be made of sub-modules. In software a high-level component can be a user transaction, and each user transactions may be comprised of other modules or components which in OOP would be objects or functions. These are simply different words for the same thing.

So yes, a component or “module” can be broken up into smaller parts. You’re contradicting what you said here:

If all logic is in the same component, it doesn’t necessarily mean the same class! (In fact it most certainly does not in most cases!). So yes, all GUI code should be in its own COMPONENT but that component can (And should if we follow SRP) be split into sub-components, or submodules as you just referred to them.

Again this goes back to your misuse of SRP/SoC. In this scenario a component fulfils a concern, that component may be made up of many classes. SRP is applied at a class level, not a component level. This has been explained to you by Scott and others on at least a dozen occasions.

Let’s put it this way: If SRP and SoC are the same thing, why do they have different wikipedia pages?

First of all, the MVC patterns/ architecture says nothing about classes in particular at all. This is obviously another one of your misunderstandings or twisting of facts to fit your prerogatives.

Secondly, you need more than three classes, because a view, or a controller or a model aren’t singular responsibilities, but rather main concerns within the application’s architecture. To me, overall, the MVC pattern is the main behavior an MVC framework offers. Each one of the 3 MVC concerns also have a good number of objects and tasks needed to achieve the goals of the framework and the application. These objects and tasks are the responsibilities.

It looks like you are mixing up the concerns of MVC and understanding them as single responsibilities. This is why your framework is missing out on class fidelity ( a term I just coined myself).

class fidelity - when an experienced programmer new to an application can relatively easily determine the single responsibilities of classes.

Scott

Nice. This echoes what Misko Hevery said here in relation to SRP: http://misko.hevery.com/code-reviewers-guide/flaw-class-does-too-much/

Class would be challenging for new team members to read and quickly “get it”

1 Like

No more or no less than any source that you can quote. The fact that there are thousands of different articles on the internet on any given subject, and these articles are filled with different and sometimes contradictory opinions is a constant source of confusion for everyone. The only option is to choose the articles that make the most sense to you. The fact that you and I have different opinions on so many subjects is a fact of life, so get used to it. Just because my opinion is different does not automatically make it wrong, just different.

That is because I cannot answer that question with a simple “yes” or “no”. It is such a complicated subject that sometimes the only sensible answer is “it depends”.

Neither does any book or internet article, they just represent an opinion with which you can either agree or disagree. I agree with some but not others - so what??? I cannot possibly agree with every opinion out there, so stop making a fuss about it.

I suggest you follow your own advice. Just because you find a small number of articles which express a particular opinion does not mean that that is the only valid opinion - it is just one among many.

The title of that document is “The Single Responsibility Principle” and in it he uses the words “This is the reason we separate concerns”. Any reasonable person would therefore conclude that “separation of responsibilities” has EXACTLY the same meaning as “separation of concerns”.

No I have not. I have clearly demonstrated that I agree with SOME opinions, just not the same ones as you. So what??? There are so many contradictory opinions out there it is physically impossible to agree with every one of them.

If you read the numerous articles on my website you will see references to those opinions with which I DO agree. so claiming that I disagree with everyone is a terminological inexactitude of gargantuan proportions.

And you don’t???

I do not work in the academic sphere, I work in the commercial sphere which operates under a different set of rules where there has to be a compromise between “perfection” and “workable”

And you don’t???

Anything calling itself a framework which does not exhibit the four characteristics mentioned in https://en.wikipedia.org/wiki/Software_framework has no right to call itself a framework.

Riiight so a peer reviewed journal is equal to a wikipedia article in authority. Really? I suggest you go and look up what academic references are and how peer review works.

But you do take concepts that come from academia and redefine them so they fit your existing code. There is a difference between theory and practice, of course, but that doesn’t mean that practice gets to redefine theoretical concepts. You don’t get to redefine relativity because you don’t like not being able to travel faster than the speed of light.

Because you clearly don’t understand what an authority is, who comes up with the concepts you abuse in the first place and even why they exist. You just see your own framework and then see someone say “SRP” and you then say “Well I must already be doing that” go look at the definition and try to make it fit, unsuccessfully, I might add.

Lets put it this way: If you were looking up a treatment for a disease would you trust wikipedia over a study in the BMJ? The same applies in computing, we just have different journals. IEEE is probably the most well known journal publisher in computing/engineering.

It also does not necessarily mean that a component should be implemented in multiple classes. You are reading what isn’t there.

Nowhere in either of Robert C. Martin’s articles (see http://blog.8thlight.com/uncle-bob/2014/05/01/Design-Damage.html and http://blog.8thlight.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html) does it mention that once you have separated your program logic into GUI logic, business logic and database logic that you should continue to split up each of those areas into smaller units. They DO NOT say that, so it is YOU who is reading what isn’t there.

Where does it say that?

Wikipedia says it clearly.

In object-oriented programming, the single responsibility principle states that every class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.

Scott

Robert C. Martin said this in the book Clean Code.

The person you like to cherry pick information from. You quote him when it suits you and you can take him out of context, but then ignore him when you are unable to do that. It’s amusing really.