Which MATLAB GUI framework to use?

I posted a “how should I go forward” question on the discussion tab for the GUI Layout Toolbox. It was suggested that I post the question here. I posted the question on the GUI Layout Toolbox page because I literally just discovered the toolbox. I came across it a couple weeks ago while researching issues for a new Matlab UI project that I am starting. I also learned that Matlab is moving its GUI framework from Java based to an HTML5-class-base framework. After playing around with some of the examples, I found that I like the GUI Layout Toolbox. The potential downside is that the GUI Layout Toolbox is based on the Java framework. It’s a downside if Matlab is moving away from the Java based framework and will no longer support it. The new UI project is one that should be around for quite a few years. I’d hate to start it with the current framework only to have to recast everything in a couple years. So my question boils down to would it be prudent to start this new project with the new GUI framework? I know this is one of those hard to answer, “it depends” questions. I’m just hoping for some guidance from folks who are more familiar with how Matlab is moving forward with this framework change.
Thanks times a gazillion,
Bill

 Accepted Answer

per isakson
per isakson on 26 Jul 2022
Edited: per isakson on 26 Jul 2022
Caveats:
  • I have not used the new GUI framework in any serious way
  • Yes “it depends”. This answer suggests how I would approach a project like "[your] new UI project".
Steps:
  • Decide to use a variant of the Model-View-Controller pattern, with a very thin GUI (see Passive View).
  • Find out whether the new framework provides the features needed. First decide on the interfaces between the components and then develop and test the GUI of my app. The point is that all (relevant) limitations of the new framework shall surface. In the tests the GUI is activated by user interaction and communication with fakes (mocks/stubs/test code/test double). Thus I don't need to think about the implementation of the rest of the app. The tests shall show whether I can proceed with the new framework.
In a recent Matlab newletter there is an article on MVC: Developing MATLAB Apps Using the Model-View-Controller Pattern. It comes with a worked example: Develop MATLAB Model-View-Controller Apps
And more links:

1 Comment

Thanks for this response. The "Steps" you've laid out are pretty much what we're going to have to do. I also appreciate the links. I will definitely check them out. I'm fortunate in that the team, albeit small, working on this project has experience in GUI development. That means that we'll be in a mode of "how to do this with Matlab" versus "how to do this".
Thanks so much,
Bill

Sign in to comment.

More Answers (1)

Are you prepared to pay the Oracle per-desktop license fee to run your Java-based code? Because the only update that Java used by MATLAB is getting is the security updates to the last free version, which Oracle has not committed to keep creating security updates for.

5 Comments

Bruno Luong
Bruno Luong on 25 Jul 2022
Edited: Bruno Luong on 25 Jul 2022
What kind of security hole are we talking about?
I never get any alert of security issues from TMW about using GUI.
Afterall it's just a GUI framework that triggers mouse/keyboard user inputs. If there is any security issue that is likely on developer's side.
https://www.oracle.com/security-alerts/cpujul2022.html
Java SE appears to be the relevant technology
Sorry; but this advisor security is clear like mud for me. What does it implie concretly on a MATLAB GUI?
Matlab isn't free, so I'm not sure cost is a factor in the decision. At least not directly. However, if Mathworks is moving away from the Java based GUI framework because of a potential increase in cost to itself and its customers, then that is a factor. Especially if they stop any support of that Java based GUI framework. And that's what I'm trying to get a feel for. Because that suggests going forward with the new framework.
Thanks,
Bill
I believe they are trying to rewrite all of their GUIs to not use Java.
I haven't heard anything yet about how they might rewrite aspects such as gunzip or how they communicate with parallel processes.
My speculation is that Java will not be removed from MATLAB within the next 5 years, in the sense that it will likely still be possible to directly call java -- but within 5 years they might have finished removing any dependency on Java in their own code.

Sign in to comment.

Products

Release

R2022a

Asked:

on 25 Jul 2022

Commented:

on 26 Jul 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!