(The code I'd have to post is huge, I'll resume to just function names)
I'm currently faced with the following issue on my project: I have a "each module from this framework can have a small view that users use to control its behavior" view-container sort of.
Basically each module can have a visual spot in a list, where users can click and see what they can do with the said module, thing is, my modules all respect the
ModuleInterface interface, so the system knows they are in fact a module and each module must respect the following:
shouldItLoad, loadModule, getModuleName, getStartingAction, getPriority all of which are essential, it sounds like it does a lot, but it's a must, yet I still feel like if I add more on top of this, I end up with an object that just does too much.
It just turned out now that I'd like each object that wants to be on that view-container to also respect the
ViewBlock interface, which would have a few functions on its own, just for my system to be able to ingest them and create that view.
We're now at minimum 9-10 functions, just so that I can get it to work. It's a hell to read through and most importantly, it does so many things, but:
- It's still that module's job to define its parameters for its view, not something else.
- If I were to opt in to passing a reusable
Modulethen sets data to, ingests it and keeps it, I still have a lot of overhead, not to say that now **I cannot enforce a contract (since I'd need to keep my
ViewBlockObjectin a variable inside of
What would the solution be here? How can I make each
Module have behavior that must be respected by each of them that wants to have a view, without overheading the
Module object itself?