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

YOUR argument is so nonsensical, so YOU please stop.

My answer in Would you agree this is the definition of a PHP framework? - #458 by tony_marston404 still stands.

“I can’t answer your point so here’s a link to a post which doesn’t answer it”

Did you even read what I wrote?

Oh, but look at what Mr. Greer said about your 9000 line monster class. (probably already posted, as I haven’t read all the answers yet, but it is so fun to post this here anyway…)

It’s generally dangerous to weigh in on design choices without context, but just glancing at the code you’ve provided I find it hard to imagine that this class bears the weight of a single responsibility (in the sense of a single reason to change) based on it’s sheer size.

Boooom! Is your monster class breaking SRP or isn’t it? It is!

Edit - or are you going to now denounce the person you’ve been quoting as behind your argument of SoC and SRP being the same as a non-source now?

Scott

Even if, for the sake of argument we say that “concern” and “responsibility” mean the same thing “separation of responsibilities” has a different meaning to “single responsibility”., one describes a lone responsibility while the other describes the relationship between them.

If only Tony would agree. He could say, “My class breaks SRP, but I don’t care. It works.” And we’d all be finished with this discussion.

Scott

How about just not making the default security bad?

1 Like

The signin page now uses https, so that should solve your issue.

Yes. You wrote the following

You have been trying me that “concern” and “responsibility” do NOT mean the same thing, and therefore SoC and SRP are NOT the same thing.

He has quite clearly said “concern” and “responsibility” are the same, therefore he is agreeing with ME and not YOU.

Your question is ridiculous as it is based on the assumption that SoC and SRP are different. I keep telling you, even by pointing to articles written by other people, that they are NOT different, but you fail to acknowledge that point. SoC and SRP are the SAME, not DIFFERENT.

It doesn’t matter if concern and responsibility mean the same thing. It doesn’t follow that “Separation of responsibilities” means the same thing a “Single responsibility”.

Your entire argument is:

“Wild goose chase”

and

“golden goose”

and

“What’s good for the goose is good for the gander”

and

“goose bumps”

“Because they all use the word goose, they all refer to the same concept”

You need to explain how “Single responsibility” means the same thing as “Separate responsibilities”

You have stated they are different:

You are saying “SRP includes something SoC does not”. How does that make them “exactly the same concept”?

This can be shown in PHP as:

$SoC = 1;
$coupling = 2;
$cohesion = 4;

$SRP = $SoC + $coupling + $cohesion;

var_dump($SRP === $SoC);

Unless you can make that evaluate to true without making any of the values zero or negative (ie, meaningless or not actually included) or changing the definition of SRP so it doesn’t include all 3 concepts, or changing the operator to something other than equality (You are saying they are EXACTLY THE SAME), then your point is null and void.

if your definition of SRP is correct then you’ll be able to do the above. Otherwise your definition of SRP is wrong and your argument is lost.

That’s 5 times you’ve been unable to answer this post, 5 times you’ve proven yourself wrong.

Your question is ridiculous as it is based on the assumption that SoC and SRP are different.

You have yourself explained the difference between them.

Your entire argument still rests on the premise that “i don’t understand the difference therefore they are the same”. It’s an appeal to ignorance, nothing else.

He said “a responsibility” is another way of referring to a concern. And we’ve said all along, that a single responsibility CAN form a concern.

How can you also just read the one sentence and ignore the rest and even come close to think he is agreeing with you?

A responsibility is another way of referring to a concern. The Single Responsibility Principle is a class-level design principle that pertains to restricting the number of responsibilities a given class has, so some of the same ideas are expressed here, but when I wrote this article (nearly 10 years ago now), I was seeking to cultivate a more general appreciation for the concept of separation of concerns across a broader architectural spectrum.

Point #1

The Single Responsibility Principle is a class-level design principle that pertains to restricting the number of responsibilities a given class has

Point #2

the concept of separation of concerns across a broader architectural spectrum

SRP is a class based concept ONLY!

SoC is a architecture based concept and CAN be referring to a single class or responsibility as a concern.

However, if you are following SoC, it DOES NOT mean you are automatically following SRP and your monster class is (almost) a great example of it. Almost, because it also breaks SoC too.

Edit: and let’s not ignore his evaluation of your 9000 line class.

It’s generally dangerous to weigh in on design choices without context, but just glancing at the code you’ve provided I find it hard to imagine that this class bears the weight of a single responsibility (in the sense of a single reason to change) based on it’s sheer size.

Edit2: And even it we told Derek your monster class does fulfill SoC, he would still say the same thing!

Scott

Balderdash! SoC and SRP are the same. “concern” and “responsibility” mean the same thing.

The “separation of concerns/responsibilities” and the “single concern/responsibility principle” mean exactly the same thing as you are taking a class which covers several concerns/responsibilities and separating it until you have several classes each of which deals with a single concern/responsibility.

Trying to say that the two principles are different because one describes a relationship while the other does not is completely bogus.

If you break a cohesive class into smaller units you are lowering cohesion, which is BAD!.

If you increase the number of classes that are required to perform a function then you are increasing coupling, which is also BAD!

Good design exhibits HIGH cohesion and LOW coupling.

A sensible person would apply SoC/SRP in order to achieve a balance between cohesion and coupling. So says Robert C. Martin in his article http://blog.8thlight.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html. Once the correct balance has been achieved you should then STOP. Your problem is that you don’t know when to stop, and you cannot see that what you are actually doing is turning a modular system into a fragmented system.

Your entire argument still rests on the premise that "i don’t understand the difference therefore they are the same. It’s an appeal to ignorance, nothing else.

It doesn’t matter if concern and responsibility mean the same thing. It doesn’t follow that “Separation of responsibilities” means the same thing a “Single responsibility”.

Your entire argument is:

“Wild goose chase”

and

“golden goose”

and

“What’s good for the goose is good for the gander”

and

“goose bumps”

“Because they all use the word goose, they all refer to the same concept”

You need to explain how “Single responsibility” means the same thing as “Separate responsibilities”

You have stated they are different:

You are saying “SRP includes something SoC does not”. How does that make them “exactly the same concept”?

This can be shown in PHP as:

$SoC = 1;
$coupling = 2;
$cohesion = 4;

$SRP = $SoC + $coupling + $cohesion;

var_dump($SRP === $SoC);

Unless you can make that evaluate to true without making any of the values zero or negative (ie, meaningless or not actually included) or changing the definition of SRP so it doesn’t include all 3 concepts, or changing the operator to something other than equality (You are saying they are EXACTLY THE SAME), then your point is null and void.

if your definition of SRP is correct then you’ll be able to do the above. Otherwise your definition of SRP is wrong and your argument is lost.

That’s 6 times you’ve been unable to answer this post, 6 times you’ve proven yourself wrong.

I’m going to keep posting this until you show how the above code evaluates to true and that “wild goose chase” means the same as “goose bumps” because they both contain the word “goose”. You’re not offering any new arguments, so I’m not dignifying you with a new response.

How can they mean the exact same thing, when one is about responsibilities/ concerns (in the plural form) and the other is talking about a single responsibility?

Scott

And one is a process: “Separation” and the other is a principle

1 Like

Look at what he wrote: “It’s generally dangerous to weigh in on design choices without context,” He is admitting straight away that he does not know how this class fits into my design, so his opinion may not be accurate.

He also says “I find it hard to imagine that this class bears the weight of a single responsibility based on it’s sheer size”. Again he is using nothing but size as a measurement, and this is completely unscientific.

As far as I am concerned that class is NOT breaking SRP as it is inherited by every Model, and each Model class is responsible for the business rules associated with a single database table. Note how I use the words “single” and “responsible”.

While some people may think that having a large number of methods in a class is ridiculous, you are obviously not aware that 75 of those methods (the ones with a “cm” prefix) are deliberately empty because they only need to be defined in a concrete class when the developer wishes to override the framework’s default behaviour. Each one of those methods is called at a particular point in the processing cycle, which then enables the developer to identify which method to use so that he knows that his code will be executed at the correct point.

If you still don’t understand what I mean then take a look at http://www.tonymarston.net/php-mysql/your-code-is-crap.html#table1 where I identify 42 methods which are used in a simple UPDATE1 pattern. Different patterns use different combinations of methods, so the abstract class has to contain all the methods that can be used by all of the patterns, although each pattern uses only a subset of the total number of methods.

Unless you know WHY I designed my class to do what it does, any criticism based on nothing but a count is therefore unscientific, ill-informed, flawed and completely bogus.

You take a class that deals with several concerns/responsibilities (note the plural) and separate it into a collection of smaller classes each of which deals with a single concern/responsibility (note the singular). The number of concerns/responsibilities remains the same, but they are now in their own separate classes instead of being in the same class.

Balderdash! SoC and SRP mean exactly the same thing. Robert C. Martin (and others) have said so. A “concern” is another way of saying “responsibility”. Separating a class which has plural of something into smaller classes each of which has singular of something is how the words “separation” and “single” can be used to mean the same thing.

Saying that one is a process while the other is a principle is just playing with words. A principle on its own is useless unless you are able to describe the process by which that principle can be implemented.

Your entire argument still rests on the premise that "i don’t understand the difference therefore they are the same. It’s an appeal to ignorance, nothing else.

It doesn’t matter if concern and responsibility mean the same thing. It doesn’t follow that “Separation of responsibilities” means the same thing a “Single responsibility”.

Your entire argument is:

“Wild goose chase”

and

“golden goose”

and

“What’s good for the goose is good for the gander”

and

“goose bumps”

“Because they all use the word goose, they all refer to the same concept”

You need to explain how “Single responsibility” means the same thing as “Separate responsibilities”

You have stated they are different:

You are saying “SRP includes something SoC does not”. How does that make them “exactly the same concept”?

This can be shown in PHP as:

$SoC = 1;
$coupling = 2;
$cohesion = 4;

$SRP = $SoC + $coupling + $cohesion;

var_dump($SRP === $SoC);

Unless you can make that evaluate to true without making any of the values zero or negative (ie, meaningless or not actually included) or changing the definition of SRP so it doesn’t include all 3 concepts, or changing the operator to something other than equality (You are saying they are EXACTLY THE SAME), then your point is null and void.

if your definition of SRP is correct then you’ll be able to do the above. Otherwise your definition of SRP is wrong and your argument is lost.

That’s 7 times you’ve been unable to answer this post, 7 times you’ve proven yourself wrong.

I’m going to keep posting this until you show how the above code evaluates to true and that “wild goose chase” means the same as “goose bumps” because they both contain the word “goose”. You’re not offering any new arguments, so I’m not dignifying you with a new response.

Your argument is totally bogus, so I’m not dignifying you with a new response.