PSClassUtils icon indicating copy to clipboard operation
PSClassUtils copied to clipboard

[R] Implementing the Command pattern

Open Stephanevg opened this issue 6 years ago • 2 comments

Analyze if we could simplify how we generate the command to Out-PSGraph using the Command Pattern

For the ones that are unfamiliar with the pattern, I recommend watching these videos:

-> https://www.youtube.com/watch?v=7Pj5kAhVBlg

This one is a bit longer, but also very good. -> https://www.youtube.com/watch?v=9qA5kw8dcSU

Ideally I would like to discuss the design of a possible solution. Please send UML (ish) diagrams via photo or so.

Stephanevg avatar Feb 02 '19 14:02 Stephanevg

I know, this is not the most beautifullest piece of art, but this is a start:

image

I am not 100% happy with this design, but It is a start to reflect / think on.

Stephanevg avatar Feb 04 '19 23:02 Stephanevg

Basically, we have:

  • A GraphCommand which inherits from Command
  • A GraphParam Base type.
  • Each possible parameter would implement GraphParam.
  • The Execute() Method of the GraphCommand object would invoke the call.

Stephanevg avatar Feb 04 '19 23:02 Stephanevg