Software Design Principles for App Designer

14 ビュー (過去 30 日間)
Eugene Davis
Eugene Davis 2020 年 12 月 1 日
編集済み: Mario Malic 2020 年 12 月 1 日
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 件のコメント
Dennis Van Dusen
Dennis Van Dusen 2020 年 12 月 1 日
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.

サインインしてコメントする。

回答 (1 件)

Mario Malic
Mario Malic 2020 年 12 月 1 日
編集済み: Mario Malic 2020 年 12 月 1 日
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.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by