Software Design Principles for App Designer
10 次查看(过去 30 天)
显示 更早的评论
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
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
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!