[Please see this gallery for the models I am discussing. I could not upload more than one image: https://imgur.com/a/78nGo]
I’m trying to set up a MVC architecture where the model is in the main process and the BrowserWindow is but a representation of this model. I’ve seen the previous topic (Electron App Database File Structure/Code Structure), and I believe this post is a continuation of that discussion. See this model for what I’m trying to accomplish in the ideal case:
Clearly, this is not directly possible, so I tried a proxy approach using remote (see imgur pic #2)
This works OK, except there is no built-in support for signalling property changes across process boundaries. So I am now considering a final model where I manually signal changes (see imgur pic #3).
This requires me to write a lot of ipc.on(’…’) and debug stuff that I really don’t want to debug. Given this background, is this the best I can do without writing a ton of Electron-specific code?
If not, how could I make things look really close to the ideal setup? What makes it difficult? Is there an alternate approach I am not considering?
If so, what would be the most effective code I could write to make this work in a good way?
I tried the final model, but for an object with 3 properties, I had to write way too much code and I think this is a non-starter. I’m out of ideas
Thanks in advance.