Wednesday, 28 June 2017

Software Engineering: Command Pattern

Behavioural Pattern - Command Pattern


Intent
Encapsulate a request as an object, thereby letting you parameterise client with different requests, queue or log requests, and support undo-able operations.

Why is this used?
This is a way for us to have a common interface to the behaviour of many different receivers each with its own set of actions.


UML diagram representation

https://www.codeproject.com/KB/Blogs/186192/1.jpg

Source code example

https://www.tutorialspoint.com/design_pattern/command_pattern.htm


More to follow...

No comments:

Post a Comment

Software Engineering: Bad Smells! (Smelly code)

Bad Smells! What are bad smells? This refers to any symptom in the source code of a program that possibly indicates a deeper problem.  ...