Skip to content

Commit 5787fdb

Browse files
committed
add info for command pattern
1 parent d7431be commit 5787fdb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: Command/Client/Program.cs

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ class Program
99
{
1010
static void Main(string[] args)
1111
{
12+
13+
/*
14+
More info: https://en.wikipedia.org/wiki/Command_pattern
15+
What problems can the Command design pattern solve?
16+
17+
Coupling the invoker of a request to a particular request should be avoided.
18+
That is, hard-wired requests should be avoided.
19+
It should be possible to configure an object (that invokes a request) with a request.
20+
21+
Implementing (hard-wiring) a request directly into a class is inflexible because
22+
it couples the class to a particular request at compile-time,
23+
which makes it impossible to specify a request at run-time.
24+
*/
25+
1226
string argument = Console.ReadLine();
1327

1428
ISwitchable lamp = new Light();

0 commit comments

Comments
 (0)