I'm currently reading Adaptive Code: Agile coding with design patterns and SOLID principles and in each principle they reference "the client". Who is "the client"?
Even in Wikipedia: https://en.wikipedia.org/wiki/Interface_segregation_principle
In the field of software engineering, the interface-segregation principle (ISP) states that no client should be forced to depend on methods it does not use.
Thanks!
Client here simply refers to the user of the code construct in question. So let's say you write a Queue
class backed by an array:
class Queue:
void enqueue(item)
item dequeue()
void resize() // doubles the size of the array if it's full
The user could be yourself, if you import your own Queue
class somewhere else, or it could be other developers, if they are using your queue class. Then in this case, your clients do not depend on resize (the queue class calls it internally, so it's not for users to call), the interface should only expose what's needed for the queue functionality
interface QueueI:
void enqueue(item)
item dequeue()