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.
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?
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â
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â
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
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â
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.