Skip to content

bekirduran/command_pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Command Pattern Example

Command pattern turns a request into stand-alone object that containts all information about the request.This transformation lets you pass requests as a method arguments, delay or queue a request’s execution, and support undoable operations.

Command objects serve as links between various GUI and business logic objects. the GUI object doesn’t need to know what business logic object will receive the request and how it’ll be processed. The GUI object just triggers the command, which handles all the details.

Command(Maintenance) Abstraction Class is

Command(Maintenance) implemented to MercedesMaintenance Class

Command(Maintenance) implemented to BMWMaintenance Class

Command(Maintenance) implemented to AudiMaintenance Class

When the calling invoker and commands on main class:

Then finally output is:

with the help of Command Pattern, you can follow Single Responsibility Principle, Open/Closed Principle and You can assemble a set of simple commands into a complex one.

About

Simple Command Pattern Example

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages