简体   繁体   English

C ++的类图

[英]class diagram for C++

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. 那个家伙问我,他正在尝试为Windows移动设备开发类似于google maps的应用程序。

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 考虑到我是一名业余C ++开发人员,从分析和设计阶段就从未从事过任何项目,因此我要求您回答我

and doesn't know abc's of design. 而且不知道abc的设计。

Thanks, 谢谢,

krisssam krisssam

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. 如果您有兴趣,我建议您阅读有关面向对象的分析和设计的书。

Maybe a bit overkill for an interview, but even there I would still go for 1 and 3 and start with 4. 采访可能有点矫over过正,但即使在那儿,我仍然会继续进行1和3并从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. 寻找少于6个播放器(模块)的尝试,并尝试观察它们如何相互作用。 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. 与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. 对于谷歌地图,我认为玩家可以是地图数据库,地图查看器,用户输入,搜索引擎,但我不是GUI / GIS /移动专家。

定义软件每个组件将要承担的职责,然后围绕这些职责充实类。

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... 图标对象及其数据成员和操作等...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM