Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Directory structure pattern/recommendations #116

Open
hugodahl opened this issue Feb 15, 2019 · 1 comment
Open

Discussion: Directory structure pattern/recommendations #116

hugodahl opened this issue Feb 15, 2019 · 1 comment

Comments

@hugodahl
Copy link
Contributor

Preface

I wanted to bring this up for discussion before making any changes since the implications are quite far-reaching. I also I didn't feel it would be a wise use of time, nor would it be considerate, to start applying or imposing a pattern without community involvement.

The Issue With the Current Structure

In working through the multiple action support, and then having @codingbandit's changes integrated, it dawned on me that our current directory structure, in both the sample as well as the template, is not sustainable for a few reasons.

  1. There will be a whole lot of xxxAction.cs file in the same root directory
  2. The same situtation is likely to affect the current plugin_inspector directory
  3. There is no clean or easy way to relate, at a glance, an action with a property inspector - or even if there is one for said action (and vice-versa)
  4. Unless a naming pattern is followed, it would be difficult to relate any graphic assets to an action, and vice-versa.

Benefits of the Current Structure

There are benefits which we can take from the current structure and apply as a good example or best/recommended practice. The one which immediately comes to mind is the plugin inspectors, and how they can share common resources - *.js, *.css, *.html, and such files.

Needs

What we really need is to a) identify and prioritize potential pain points and pitfalls, b) determine which issues must be addressed through best practice examples, and which are acceptable with simple guidance provided, and c) implement the changes as agreed upon.

Issues (in no specific or ranked order)

  1. The larger the number of actions defined in a plugin, if one action is implemented in one .cs file, the root directory can get to feeling cluttered very quickly
  2. Difficulty quickly identifying which assets are related to which action(s), if any.
  3. Difficulty quickly identifying whether an action has a related property inspector, and vice versa
  4. If an action does have assets and a property inspector, is there any overlap or reuse of the assets between the action and the property inspector?
  5. How can we best structure the plugin inspectors to benefit from common sources, such as JS libraries, CSS files, etc.
  6. Should we isolate the core and base classes as well as interfaces (ConnectionManager, BaseStreamDeckAction) from the rest of the implementation of the custom actions?

Closing

I have some thoughts (and opinions) on how I envision the project being structured, which I will detail in a later comment, however, I would also like to get some feedback and comments on whether this really is an issue which should be addressed at this time (am I a gun jumping alarmist?), and so, thoughts, opinions, and feedback on possible structure.

@hugodahl
Copy link
Contributor Author

The pattern that feels most obvious or natural to me at this time, is to Have a directory structures (source and deployment) along these lines:

Source Directory Layout

 +-----------------------------------------------+  
 |                                               |  
 | [Project Root]                                |  
 | +                                             |  
 | |                                             |  
 | +---+ Root files*                             |  
 | |                                             |  
 | |                                             |  
 | +---+ /Actions                                |  
 | |   |                                         |  
 | |   +--+ /MyCustomAction01                    |  
 | |   |  |                                      |  
 | |   |  +---+ [Compiled code files for Action] |  
 | |   |  |                                      |  
 | |   |  +---+ /Assets                          |  
 | |   |  |                                      |  
 | |   |  +---+ /PluginInspector                 |  
 | |   |                                         |  
 | |   |                                         |  
 | |   +---+ /MyCustomAction02                   |  
 | |   |                                         |  
 | |   |                                         |  
 | |   +---+ /MyCustomAction03                   |  
 | |   |                                         |  
 | |   |                                         |  
 | |   +---+ /MyCustomAction04                   |  
 | |                                             |  
 | |                                             |  
 | +---+ /PluginInspector                        |  
 |     |                                         |  
 |     |                                         |  
 |     +---+ [Shared PI files]                   |  
 |                                               |  
 +-----------------------------------------------+  

Deployed Directory Layout

 +--------------------------------------------------------------+
 |                                                              |
 | [Build Root]                                                 |
 | +                                                            |
 | |                                                            |
 | +----+  manifest.json                                        |
 | |                                                            |
 | +----+  Plugin.exe                                           |
 | |                                                            |
 | +----+  [other files supporting the .exe]                    |
 | |                                                            |
 | +----+  /PluginInspector                                     |
 |      |                                                       |
 |      |                                                       |
 |      +---+ [Shared PI files]                                 |
 |      |                                                       |
 |      |                                                       |
 |      +---+ Actions                                           |
 |          |                                                   |
 |          |                                                   |
 |          +---+ /MyCustomAction01                             |
 |          |   |                                               |
 |          |   +---+ [Copy of src/Actions/MyCustomAction01/PI] |
 |          |                                                   |
 |          |                                                   |
 |          |                                                   |
 |          +---+ /MyCustomAction01                             |
 |          |   |                                               |
 |          |   +---+ [Copycofrsrc/Actions/MyCustomAction02/PI] |
 |          |                                                   |
 |          |                                                   |
 |          +---+ /MyCustomAction01                             |
 |              |                                               |
 |              +---+ [Copycofrsrc/Actions/MyCustomAction03/PI] |
 |                                                              |
 +--------------------------------------------------------------+

Issue with this layout

Two notable issue with this layout is that there is additional management needed to take the Property Inspector directories from the individual actions into the deployed PluginInspector directory, and similarly with the images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant