visual-studio Visual Studio 中的类设计器 - 值得吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Class Designer in Visual Studio - is it worth it?
提问by David A Gibson
Does anybody use the Class Designer much in Visual Studio?
有人在 Visual Studio 中经常使用类设计器吗?
I have downloaded the Modeling Power Toys for 2005 and have been impressed with what I've seen so far. The MSDN Class Designer Blog doesn't seem to have been updated for a while but it still looks quite useful.
我已经下载了 2005 年的 Modeling Power Toys,到目前为止我所看到的给我留下了深刻的印象。MSDN Class Designer Blog 好像有一段时间没有更新了,但是看起来还是很有用的。
Is the Class Designer a quick way to build the basic application or should I just work out on paper and then start coding?
类设计器是构建基本应用程序的快速方法,还是我应该在纸上工作然后开始编码?
Thanks
谢谢
回答by Orion Edwards
As a visualization tool, or for exploratory purposes (drawing up multiple options to see what they look like) it's not bad, but generally I find the object browser does fine for most stuff I care about.
作为一种可视化工具,或出于探索目的(绘制多个选项以查看它们的外观),这还不错,但通常我发现对象浏览器对我关心的大多数东西都很好。
As a code generation tool, it's a terrible idea.
作为代码生成工具,这是一个糟糕的主意。
The whole idea that we will design all our code structure first, then fill in the blanks with small bits of implementation is fundamentally broken.
我们将首先设计我们所有的代码结构,然后用少量的实现来填补空白的整个想法从根本上被打破了。
The only time you actually know what the code structure should look like, is if you've done the exactsame thing before - however then you can just useyour previous code, and you don't need to draw up any new code in any kind of designer.
您真正知道代码结构应该是什么样子的唯一一次是,如果您以前做过完全相同的事情 - 但是您可以只使用以前的代码,而无需在任何地方编写任何新代码那种设计师。
If you decide ahead of time to use a particular class structure before you've actually tried to solve the problem, there is a 100% chance that you will pick the wrong design, and shoot yourself in the foot.
如果您在实际尝试解决问题之前提前决定使用特定的类结构,那么您有 100% 的机会会选择错误的设计,从而使自己陷入困境。
回答by Iain Holder
Short answer: No.
简短的回答:没有。
Longer answer: No, not at all. There's a reason it hasn't been updated.
更长的答案:不,完全不是。没有更新是有原因的。
[EDIT] @ MrBrutal - Sorry - do you mean to generate code or just represent a design? Because I took your question as to generate code for you.
[编辑] @ MrBrutal - 抱歉 - 你的意思是生成代码还是只是代表一个设计?因为我把你的问题看作是为你生成代码。
回答by Dave Cousineau
I guess this is old, but I use it a lot. It could definitely be improved, but I find it extremely useful to be able to visualize my class structure, and to be able to jump to a specific class or method by clicking on it visually.
我想这是旧的,但我经常使用它。它肯定可以改进,但我发现能够可视化我的类结构,并且能够通过直观地单击它来跳转到特定的类或方法,这非常有用。
It's also slightly easier to add classes/interfaces with than the solution explorer, although the new files always end up in the root folder, instead of the same folder as the CD.
与解决方案资源管理器相比,添加类/接口也稍微容易一些,尽管新文件始终位于根文件夹中,而不是与 CD 相同的文件夹中。
The main benefit I find is to be able to see a group of closely related classes at once. I think the best approach might be to have a single CD for each code folder/namespace.
我发现的主要好处是能够同时看到一组密切相关的类。我认为最好的方法可能是为每个代码文件夹/命名空间准备一张 CD。
回答by Jonas Folles?
I've used it a couple of times to get some decent looking class diagrams to put in presentations/blogposts etc. But thats about it...
我已经使用它几次来获得一些看起来不错的类图来放入演示文稿/博客文章等中。但仅此而已......
Any suggestions on other simple UML/class diagram tools that is easy to use and create some nice looking diagrams? Must be able to generate diagrams from .NET code.
关于其他简单的 UML/类图工具的任何建议,这些工具易于使用并创建一些漂亮的图表?必须能够从 .NET 代码生成图表。
回答by Phil Bachmann
The comments here suggest that few people find the class designer useful.
这里的评论表明,很少有人认为类设计器很有用。
Amusing to note that Microsoft designed the class designer to be a useful replacement to useless UML (UML diagrams being untrustworthy once they lose synchronisation with source code).
有趣的是,Microsoft 将类设计器设计为无用 UML 的有用替代品(UML 图一旦与源代码失去同步就不可信任)。
The trouble with class diagrams is that they tell us what we already know.
类图的问题在于它们告诉我们我们已经知道的东西。
回答by Jon Limjap
I only use the class designer to display my existing classes, but I don't use it the other way, e.g., design your classes there then let it generate the code.
我只使用类设计器来显示我现有的类,但我不会以其他方式使用它,例如,在那里设计你的类然后让它生成代码。
回答by Tuoski
I have tried it out couple of times, mainly for viewing existing classes. If it would show all the relationships, it would be more usefull. Now it only shows inheritation.
我已经尝试了几次,主要是为了查看现有的课程。如果它能显示所有的关系,它会更有用。现在它只显示继承。
回答by Keith
I find it useful sometimes, more often for documentation afterwards.
我发现它有时很有用,更多时候用于之后的文档。
It's a new little utility, but I don't think you get the full functionality in VS Pro - I think you need Architect's Edition.
这是一个新的小实用程序,但我认为您无法在 VS Pro 中获得全部功能 - 我认为您需要 Architect's Edition。

