Software Design Principles for App Designer

13 views (last 30 days)
Eugene Davis
Eugene Davis on 1 Dec 2020
Edited: Mario Malic on 1 Dec 2020
Two questions here. The first is if there is a good reference for how to design a GUI application from App Designer. I've had some limited success with UML constructs, but I wonder if there is a better "philosophical" approach to putting together a GUI. Especially one that is not super complex, but complex enough that things get messy fast when I try to improve the application.
The second question is related. Being old-school I learned the dogma about not using global variables. Yet in App Designer it seems that the use of app.xxx variables is the preferred way to house variables. It can get confusing mixing local scope variables with app variables. Are there best practices to follow?
  1 Comment
Dennis Van Dusen
Dennis Van Dusen on 1 Dec 2020
Well, after many hundred lines of coding, I feel the same way about these issues. I had to limit myself often as I found no easy way of using certain forms of global variables. I had to re-do the GUI as it became confusing (to me). Yes, same impressions. One issue is the waiting for improvement - you just have to forget some of the 'elegance' and get moving with it.

Sign in to comment.

Answers (1)

Mario Malic
Mario Malic on 1 Dec 2020
Edited: Mario Malic on 1 Dec 2020
Hello,
These app.name are actually properties.I have written quite a complex app, and I can tell already, you'll never going to be happy how it looks, because you can always think of a better way to rewrite things.
I would suggest you to try to keep the number of properties as low as possible. Work with data from components whenever possible. If you actually need a lot of properties then gather them in a structure (I'll recommend not to), it's better to work with classes (I haven't tried them yet in App Designer). There's no need for global variables what-so-ever, as everything is connected with properties and public methods if you want to access app stuff from outside.
Regarding the elegance, I like how my app looks like, even though there are plenty of fields, components, everything can be tidy with components such as Tab Group, Panel, Button Group etc.
Regarding the coding, if you know a little bit about object-oriented programming, you would treat the so-called "helper" functions in a different way.

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!