Tuesday, November 9, 2021

Simple way/pattern to separate GUI from model

Prepare your model as a separate executable that reads input from file and writes output to a file. Then you can code your GUI in whatever language you like (e.g. Excel macros) that takes input from user, writes them to file, runs the model executable and reads outputs from file when executable finishes.

This completely decouples GUI from implementation. Compared to a DLL, it has a simpler interface, it will not crash your JVM if there is an error in model, and let's you run models in parallel much easier and also facilitates easy batch run of model executable via scripts.

No comments:

Post a Comment