Java Android 多类图
我想编写一个用于锻炼的应用程序,并且需要一些有关类图的建议。我希望用户能够在健身房使用该应用程序。用户将开始锻炼,进行任意数量的练习,每个练习有任意组数。
我的想法是这样的:
-每次锻炼都有一个日期和时间。即使用户每天锻炼超过一次,这也使它们能够保持独特。
- 每个练习都有一个名称。
- 每组都有重量和重复次数。
示例:
20xx-XX-XX XX:XX(锻炼) 深蹲(练习) 100x5(套) 100x5(套) 100x5(套) 卧推(练习) 50x8(套) 50x8(套) 50x8(设置)
那么,将所有这些组合在一起的最佳方法是什么?我想也许每个锻炼都可以有一个地图,其中练习作为键,数组列表包含集合作为值。这是一个好的解决方案吗?或者有更好的解决方案吗?
I want to write an app for workouts and I need to some advice for the class diagram. I want the user to be able to use the app at the gym. The user will start a workout, do an arbitrary number of exercises, each with an arbitrary number of sets.
The way I thought of it is like this:
-Each workout has a date and a time. This enables them to be unique even if the user works out more than once a day.
-Each exercise has a name.
-Each set has a weight and a rep count.
Example:
20xx-XX-XX XX:XX (workout)
Squats (exercise)
100x5 (set)
100x5 (set)
100x5 (set)
Bench press (exercise)
50x8 (set)
50x8 (set)
50x8 (set)
So, what is the best way to put all this together? I thought maybe each workout could have a map with exercises as keys and arraylists containing sets as values. Is this a good solution? Or are there better solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)