C++ 的类图
伙计们 !我明白我之前的问题并不是针对你们的。我也为此道歉。
让我以不同的方式摆姿势。
以我的情况为例,昨天我面临面试。
那里的人问我,他正在尝试为他的 Windows 移动设备开发一个类似于谷歌地图的应用程序。
他要求我为该应用程序绘制一个类图。
这对我来说就像一个保镖。
在这种情况下,我的做法应该是什么?我应该从哪里开始?我该如何看待问题?
我希望这一点能得到更好的理解。
考虑到我是一名业余 C++ 开发人员,从未参与过任何分析和项目的项目,所以我请求您回答我。设计阶段
,不知道设计的ABC。
谢谢,
克里斯萨姆
Guys ! I understood that my previous question did not meant to you guys as per my intentions. I apologize for the same.
Let me pose in a different way.
Take my case, yesterday I faced an interview.
The guy out there asked me that he is trying to develop an application similar to google maps for his windows mobile device.
He asked me to come up with a class diagram for the application.
It was like a bouncer for me.
In such cases, what should be my approach ? where should I start ? How should I look at the problem ?
I hope this is better understood.
I request you to answer me considering that I am an amateur C++ developer who has never worked on any projects from the analysis & design phase
and doesn't know abc's of design.
Thanks,
krisssam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于面试来说可能有点矫枉过正,但即使在那里,我仍然会选择 1 和 3,并从 4 开始。
对于谷歌地图,我假设玩家可以是地图数据库、地图查看器、用户输入、搜索引擎,但我不是 GUI/GIS/移动专家。
Maybe a bit overkill for an interview, but even there I would still go for 1 and 3 and start with 4.
For google-maps, I assume that players could be the map-database, the map-viewer, the user-input, the search-engine, but I'm not a GUI/GIS/mobile expert.
首先,您需要清楚地了解应该写什么。用英语表达这种理解。现在每个名词都是一个类的候选者。每个动词都是方法的候选者。出现在同一个句子中的名词是关联的候选者。
这听起来很简单。那是因为我把它简化了很多。实际上还有更多内容。清楚地理解应该单独写什么是具有挑战性的。如果您有兴趣,我建议您阅读一本有关面向对象分析和设计的书。
First you need a clear understanding about what you should be written. Formulate that understanding in English. Now every noun is a candidate for a class. Every verb is a candidate for a method. and nouns that appear in the same sentence are candidates for association.
This sounds quite simple. That's because I simplified it a lot. Actually there is much more to it. Getting a clear understanding about what should be written alone is challenging. If you are interested I suggest reading a book on object oriented analysis and design.
定义软件每个组件的职责,然后围绕这些职责构建类。
Define the responsibilities that each component of the software will have, then flesh classes around those.
这与语言无关。
类图 - 意味着您需要识别在此应用程序中“播放”的主要对象。
地图对象及其数据成员和操作
图标对象及其数据成员和操作等...
It doesn't relate to the language.
Class diagram - means you need to identify the major objects that "plays" in this app.
The map object and it's data members and actions
the icon objects and it's data members and actions ect...