clean-code-php
clean-code-php copied to clipboard
Interface Segregation Principle design flaw
In ISP there are severe design flaws which clearly indicate you have no experience with goverment employees:
class Human implements Employee
{
public function work(): void
{
// ....working --> instance would likely throw UnknownOperationException
}
public function eat(): void
{
// ...... eating in lunch break --> entire working hours IS-A lunch break; it may or may not have anything to do with eating
}
}
Also, in Good: Not every worker is an employee, but every employee is a worker. --> Again, you have not met goverment employees.
All this makes it confusing to grasp the concept for some instances :wink:
You always can give another example in PR
Surely this baseless issue is not serious, right? 😅
The example about ISP is an example of ISP. Not an example about working with private/govt. employees. It's succinctly explained without building an authentic, ready-for-production interface, haha.
which clearly indicate you have no experience with goverment employees:
I really believe this issue is a joke? haha
Was laughing ... a bit :-) Besides, shouldn't it be class Employee implements Human
?
But yes, I think somebody had success in being funny.
Besides, shouldn't it be
class Employee implements Human
?
@archfrog no, because it is not a human in global context, but a human in context of employees.