Refactor helper methods: utils class vs command classes #2979
Replies: 1 comment 1 reply
-
|
There was also another thread related to the The original motivation behind implementing some methods in the command base class was to expose to contributors only what's relevant. That way for example, you're not bothered with things like request digest when building commands based on Microsoft Graph. That said, using a base class is not the only way to implement it and alternatively, we could also consider implement it all such functions in a separate module, like Utils today. To avoid Utils become a catch-all place for adding code and simplify discoverability, we should consider breaking it up in multiple, logically related modules, like validation, spo, etc. If we moved all utils to this one place, it would make it easier to document and reuse them. As for more specialized methods like I think breaking up utils and moving functions from base classes to utils is an easy choice. Moving specialized commands like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion started here: #2918 (comment)
We currently have some base methods that provide helper functionality in that base class. We also use the
getAppObjectIdin them365 aad appcommands. We could pick to have a an abstractedAppCommandclass so we can have 1 implementation instead of the multitude we have now (used inapp-get,app-role-add,app-role-delete,app-role-listandapp-setcommands (as well as this one but this might be a bit of an odd duck as this in the future should inherit from whatever we decide in #2961.Yet discussing that @waldekmastykarz pointed out it makes more sense to revisit and refactor or extend our
Utilsand provide (grouped) helper methods there. It feels like we should design both how ourUtilsshould work and to research what we could move there for a V1.Beta Was this translation helpful? Give feedback.
All reactions