'"Client" concept in OOP Design Patterns?

I read many topics about OOP Design Patterns of GoF, but i am not sure about "Client" concept. So what is it? How can we realize it in our application. Thank!



Solution 1:[1]

As a pattern, a client is an actor that initiates an interaction with a server, which is a functional, but typically passive, actor. Acting on the client's behalf as described by a request, the server performs some action and makes a report back in the form of a response.

As such, the point of a client interface is to make it convenient or possible for arbitrary code to formulate a request and attract the attention of a server. Since the request message might be conveyed over a wide variety of media (a different memory space, for example), some kind of transparent transport is usually involved, hidden behind this request interface.

That's pretty much the long and short of it as a concept. One of the drawbacks of a very flexible pattern (which certainly applies to client/server) is one needs to descend into a specific example, framework or library to speak concretely.

Solution 2:[2]

The client is just another module, or class, form the system use the concrete Pattern (all or part of the components construct the pattern)

Solution 3:[3]

A client is a caller/consumer. A client is not a subclass/implementer. In terms of a method, a client is the caller of that method. In terms of a class, a client is the caller of methods in that class.

You could say that every method has a client, because without a caller a method is dead code; however, the term client is typically reserved for the caller of a public method, since private methods are just implementation details, not relevant to design.

In a design diagram, such as a UML class diagram, a client indicates where the public access points are and how the design is used after it is implemented.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 phs
Solution 2 Simeon Angelov
Solution 3 jaco0646