uml

Is UML practical? [closed]

心不动则不痛 提交于 2019-11-26 09:15:30
问题 In college I\'ve had numerous design and UML oriented courses, and I recognize that UML can be used to benefit a software project, especially use-case mapping, but is it really practical? I\'ve done a few co-op work terms, and it appears that UML is not used heavily in the industry. Is it worth the time during a project to create UML diagrams? Also, I find that class diagrams are generally not useful, because it\'s just faster to look at the header file for a class. Specifically which

UML aggregation vs association

不羁岁月 提交于 2019-11-26 09:07:12
问题 Here I am, with another question about aggregation and association. I wanted to learn some basics of UML, so I started reading \"UML distilled\" by Martin Fowler. I read both chapters about classes, and there is one thing that I can\'t fully grasp I think, and that is aggregation vs association. In the book there is this quote: In the pre-UML days, people were usually rather vague on what was aggregation and what was association. Whether vague or not, they were always inconsistent with

Explanation of the UML arrows

让人想犯罪 __ 提交于 2019-11-26 07:51:07
问题 I have recently been studying UML and drawing simple diagrams with ordinary plain arrows between classes, but I know it\'s not enough. There are plenty of other arrows: generalization, realisation and etc. which have meaning to the diagram reader. Is there a nice resource which could explain each arrow (ordinary, plain, dotted, diamond-filled, diamond)? It would be the best if it will have some code examples for them. 回答1: Here's some explanations from the Visual Studio 2015 docs: UML Class

Aggregation versus Composition [closed]

爱⌒轻易说出口 提交于 2019-11-26 05:53:04
I've had a hard time understanding the difference between composition and aggregation in UML. Can someone please offer me a good compare and contrast between them? I'd also love to learn to recognize the difference between them in code and/or to see a short software/code example. Edit: Part of the reason why I ask is because of a reverse documentation activity that we're doing at work. We have written the code, but we need to go back and create class diagrams for the code. We'd just like to capture the associations properly. The distinction between aggregation and composition depends on

What is the correct way to represent template classes with UML?

99封情书 提交于 2019-11-26 05:34:47
问题 On a UML diagram, what is the correct way to represent a template class? 回答1: Normal rectangle with a dotted rectangle in the top right corner, to represent the template parameter. Something like this: ....... ___________: T : | :.....: | | | ClassName | | | |______________| 回答2: A more useful approach is to use a UML Classifier for the Template. This is a UML Element that represents an extension to the UML notation. If your tool supports profiles create the Classifier within one. Define the

What is the difference between aggregation, composition and dependency? [duplicate]

纵饮孤独 提交于 2019-11-26 04:02:03
问题 This question already has an answer here: What is the difference between association, aggregation and composition? 17 answers What is the difference between aggregation, composition and dependency? 回答1: Aggregation implies a relationship where the child can exist independently of the parent. Example: Class (parent) and Student (child). Delete the Class and the Students still exist. Composition implies a relationship where the child cannot exist independent of the parent. Example: House

PHP UML Generator [closed]

风格不统一 提交于 2019-11-26 03:01:35
问题 How do I generate UML diagram based on existing classes in PHP? 回答1: There's also the PHP UML tool available from pear. PHP_UML: Can generate UML/XMI files in version 1.4, or in version 2.1 (logical, component, and deployment views) Can generate an API documentation in HTML format Can generate PHP code (code skeleton) from a given XMI file Can convert UML/XMI content from version 1.4 to version 2.1 Install it on the command line via: $ pear install pear/php_uml (This used to be $ pear install

Design Patterns: Abstract Factory vs Factory Method

痴心易碎 提交于 2019-11-26 02:15:45
问题 Note: Questions are at the end of the post. I have read the other stackoverflow threads regarding Abstract Factory vs Factory Method . I understand the intent of each pattern. However, I am not clear on the definition. Factory Method defines an interface for creating an object, but lets subclasses decide which of those to instantiate. A factory method lets classes defer instantiation to subclasses. By contrast, an Abstract Factory provides an interface for creating families of related or

Aggregation versus Composition [closed]

半世苍凉 提交于 2019-11-26 01:56:24
问题 I\'ve had a hard time understanding the difference between composition and aggregation in UML. Can someone please offer me a good compare and contrast between them? I\'d also love to learn to recognize the difference between them in code and/or to see a short software/code example. Edit: Part of the reason why I ask is because of a reverse documentation activity that we\'re doing at work. We have written the code, but we need to go back and create class diagrams for the code. We\'d just like

轻松学DDD之二:如何高效消化知识

依然范特西╮ 提交于 2019-11-26 01:55:40
轻松学DDD之二:如何高效消化知识   我是2012年开始接触DDD的,后续研读过几遍《领域驱动设计:软件核心复杂性应对之道》,也用DDD做过项目。总的感受是DDD的一些概念比较晦涩难懂,很难掌握,因此想写个系列短文,希望能帮助大家更轻松地理解DDD。文章很多都是我个人体会和理解,难免有错误,希望大家能及时指正,共同探讨提高。前面短文链接:    轻松学DDD之一:模型驱动设计   本文是系列短文第二篇,介绍 如何高效消化知识 。      1. 知识来源 在讲如何消化知识前,我们要明确下建模的知识来源有哪些。首先我们通过下图来考察模型、领域、软件、现实世界、计算机系统等几个概念的关联。 现实世界(蓝线左半边)和计算机系统(蓝线右半边)。 我们把用户需求理解为用户要求我们构建一个特定的计算机系统,通过它用户能按自己的期望来改变现实世界。比如淘宝网就是一个这样的计算机系统,通过它阿里巴巴可以让商品销售变得更快捷、更方便、成本更低。 领域和软件。 领域就是用户需求和从用户需求这个视角出发对现实世界的认知集合;软件就是可以让计算机系统按照用户期望方式来运转的程序。 领域模型。 它富含领域知识,与实现绑定,能够把领域和软件有效地耦合起来,从而能够让我们基于模型快速开发功能丰富的软件产品。 从上面的认知我们可以知道 模型就是在用户目标和软件实现技术的约束下对领域知识的精确化、结构化和抽象。