I think there needs to be a decision made at this point on how we’re
going to handle multiple windows / molecules. In the case that we
create a new MainWindow and then .show() it, then the way the plugin
system needs to be setup is that we have “Factories” where we return a
new instance of the plugin. That way each new MainWindow has it’s own
version relating to the molecule for that window.
The other possibility is to just make it so that opening a new file
opens an entirely new thread and the program goes off on it’s own.
Meaning our plugins would be bound to that version.
As of right now, the Engine plugins are based on the Factory system
where each time the plugin gets loaded a new Engine is instanciated. So
the interface to the actual plugin is just a class that has one function
newEngine() which returns an Engine pointer.
I think that I prefer the threaded method where each molecule gets it’s
own execution space for a couple reasons. The main reason being that
it’s going to be easier on us and with the increase in dual core
processors, there is actually a benefit of each app being it’s own
thread. The downside is communication between windows.
Well, let me know what you guys think or if i’ve said something wrong or
you have any other ideas.