Plugin Architecture
-
Hey,
I am currently starting to build out a new Plugin and was wondering what architecture you are using for code structuring and if you can share some tips.For example the MVC (Model View Controller) architecture seems like a popular approach in software in general. MVVM, Atomic Design and Event System are other possible approaches.
I am coming from the React Web and Mobile world where software is usually structured in a lot of mini components that are organized in a tree like manner. There are a lot of container components that simply wrap other components. I am trying to encapsulate my components in HISE in a similar way now. I've seen some people using encapsulation like
Filter.js
that contains the Callbacks, the UI and the logic in one file.- Do you split the logic / ui and put them in a folder or do you keep everything in one file?
- How do you manage the flow of the application?
- Are there any patterns I should be aware of that are commonly used for Plugin development?
- How do you manage state? Data that is required by multiple individual components.
Ultimately I would like to have a architecture where a third party developer can jump in and know whats going on (this third party developer will be me after one weekend of not looking into the project :). I feel like a lot of architecture decisions come with seniority and experience in this domain which I am currently lacking.
-
@oskarsh Just be aware that there is a sweet spot how how much "architecture" your plugin requires. You can easily overcomplicate the development with a concept that tries to generalize every single aspect.
As for software paradigms, the one that I found most useful in plugin development is the broadcaster / listener paradigm (aka. observer pattern). model (check the broadcaster system for a inbuilt system that enforces this paradigm). you basically define event sources and attach stuff that reacts to it in a separate step. This removes much of the logic from the actual coding and the scripts become more declarative in nature.