C++ 的类图

发布于 2024-10-09 05:11:09 字数 356 浏览 5 评论 0原文

伙计们 !我明白我之前的问题并不是针对你们的。我也为此道歉。

让我以不同的方式摆姿势。

以我的情况为例,昨天我面临面试。

那里的人问我,他正在尝试为他的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

人海汹涌 2024-10-16 05:11:09

对于面试来说可能有点矫枉过正,但即使在那里,我仍然会选择 1 和 3,并从 4 开始。

  1. 询问尽可能多的规范,这样你就知道预期的内容
  2. 在可能/需要时,制作用例以获得清晰的视图关于如何使用
  3. 从高层次开始,关注主要功能。寻找最好少于 6 个玩家(模块)并尝试看看他们如何互动。定义职责和接口。
  4. 将这些参与者分解为子模块,并查看它们如何交互(还定义职责和接口)。重复直到您拥有与 4 并行的可实现实体(类)
  5. ,对于架构,查看它将如何部署以及需要/可用哪些语言/框架/库。

对于谷歌地图,我假设玩家可以是地图数据库、地图查看器、用户输入、搜索引擎,但我不是 GUI/GIS/移动专家。

Maybe a bit overkill for an interview, but even there I would still go for 1 and 3 and start with 4.

  1. ask as much specifications as possible, so you know what is expected
  2. When possible/needed, make use cases to get a clear view on how it will be used
  3. Start high level, focus on the main features. Look for preferably less than 6 players (modules) and try to see how they interact. Define responsabilites and interfaces.
  4. Break up these players in submodules and see how these interact (also define responsabilites and interfaces). Repeat until you have implementable entities (classes)
  5. in parallel with 4, for architecture, see how it will be deployed and what language/frameworks/libraries are needed/available.

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.

如痴如狂 2024-10-16 05:11:09

首先,您需要清楚地了解应该写什么。用英语表达这种理解。现在每个名词都是一个类的候选者。每个动词都是方法的候选者。出现在同一个句子中的名词是关联的候选者。

这听起来很简单。那是因为我把它简化了很多。实际上还有更多内容。清楚地理解应该单独写什么是具有挑战性的。如果您有兴趣,我建议您阅读一本有关面向对象分析和设计的书。

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.

|煩躁 2024-10-16 05:11:09

定义软件每个组件的职责,然后围绕这些职责构建类。

Define the responsibilities that each component of the software will have, then flesh classes around those.

少女七分熟 2024-10-16 05:11:09

这与语言无关。
类图 - 意味着您需要识别在此应用程序中“播放”的主要对象。

地图对象及其数据成员和操作

图标对象及其数据成员和操作等...

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文