Download presentation
Presentation is loading. Please wait.
1
2018年11月28日7时21分
2
张炜 Technical Evangelist Microsoft
2018年11月28日7时21分 可视化的软件架构设计 张炜 Technical Evangelist Microsoft
3
议程 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分
KEY MESSAGE: What we will cover. SLIDE BUILDS: None SLIDE SCRIPT: Successfully building complex applications requires a solid architecture and common understanding of the requirements across the development team. Visual Studio.NET Enterprise Architect enables application requirements, architecture, and functionality to be visually specified and communicated using software modeling. Based on the UML 1.2 software modeling specification, these features also include a rich set of common diagrams, including work, process, and data flow, for the most effective communication. In this session you will learn about the types of models that can be created, code generation, reporting, and capabilities of these tools. SLIDE TRANSISTION: Prerequisites
4
课程准备 难度:中 有一定桌面或者Web应用的开发经验
2018年11月28日7时21分 课程准备 有一定桌面或者Web应用的开发经验 有一定使用 Visual C#™, Visual C++®, Visual Basic®, or Visual Basic .NET的经验 KEY MESSAGE: Prerequisites SLIDE BUILDS: None SLIDE SCRIPT: Experience with VS languages and having developed desktop or web applications is helpful. 难度:中
5
议程 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分 KEY MESSAGE: Agenda
SLIDE BUILDS: None
6
建模 为什么要用模型? 在创建系统之前,可以更好的理解潜在的一些风险 模型可以让我们描述系统的结构和行为,并且利用它和同事沟通
2018年11月28日7时21分 建模 为什么要用模型? 在创建系统之前,可以更好的理解潜在的一些风险 模型可以让我们描述系统的结构和行为,并且利用它和同事沟通 模型提供了指导我们创建系统的模板,我们还可以利用它为使用系统的人提供帮助 模型还描述了我们所做的决策 KEY MESSAGE: Understanding the purpose of UML. SLIDE BUILDS: None SLIDE SCRIPT: Before we look at UML and the Enterprise Architect’s support for UML we should actually first look at why we model. Models help us in numerous areas. The first is that it helps us visualize a system as we want it to be and then easily discuss some of the potential problems and risks that might occur before we begin building the system. Second models helps us to easily communicate the specifications and requirements of the system to others involved in the software development process. Third models give us a roadmap or template for developing the system and helps others in understanding the current state of the system. Finally once the software is developed and during the development process the models that we have made help us document the decisions that we have made along the way. SLIDE TRANSISTION: UML Defined
7
建模 企业架构功能 UML 软件建模 完全支持 UML 1.2 建模规范 对现有的代码进行UML反向工程
2018年11月28日7时21分 建模 企业架构功能 UML 软件建模 完全支持 UML 1.2 建模规范 对现有的代码进行UML反向工程 生成可订制的Visual Basic, C++ 和 C# 代码框架 自动检查语义错误 可定制的 UML 报表 KEY MESSAGE: Enterprise Architect specific functionality. SLIDE BUILDS: None SLIDE SCRIPT: You can generate customizable code stubs or “skeletons”. You can do this to C#, VB.NET or C++. It will check for logical errors like circular references or physical errors such as the incorrect application of a datatype that is not supported in the language that you are targeting. In addition you can generate customizable UML reports. We’ll be looking at these later in the presentation. The Enterprise Architect also is the only tool on the market that supports code skeleton generation for C#. SLIDE TRANSISTION: Now let’s take a closer look at UML.
8
议程 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分 KEY MESSAGE: Agenda
SLIDE BUILDS: None
9
使用 UML UML 的定义 UML 是一种这样的语言: 可视化 功能规范 系统构造 文档化 使用 UML 让你用一种标准的方法来设计软件
2018年11月28日7时21分 使用 UML UML 的定义 UML 是一种这样的语言: 可视化 功能规范 系统构造 文档化 使用 UML 让你用一种标准的方法来设计软件 UML 是一种开放式标准 KEY MESSAGE: Understanding the purpose of UML. SLIDE BUILDS: None SLIDE SCRIPT: For many programmers there is only the mental process of modeling going on during the implementation phase of a project. UML exists to give a framework to the modeling stage of the project. UML is a language that has constructs and symbols to help with Visualizing, Specifying, Constructing, and Documenting Software. In addition the fact that UML is based on an open standard allows you to ability to generate diagrams that can be understood by other organizations and individuals that you work with. Software projects tend to produce a great many artifacts during the design, implementation, and review process of software development. Requirements documents, Design Documents, Project plans, Prototypes, etc. are all integral parts of a software development project. UML gives expression to all of these through standardized constructs that can be implemented in a variety of tools one of which is the Enterprise Architect included with the Enterprise Edition of Visual Studio. SLIDE TRANSISTION: Different UML Diagrams available.
10
使用 UML 图表类型 结构化图表 (静态) 行为图表 (动态) 类(Class)图 (静态结构) 用例(Use case)图
2018年11月28日7时21分 使用 UML 图表类型 结构化图表 (静态) 类(Class)图 (静态结构) 构件(Component)图 实施(Deployment) 图 行为图表 (动态) 用例(Use case)图 顺序(Sequence) 图 协作(Collaboration)图 状态(Statechart) 图 活动(Activity)图 KEY MESSAGE: Overview of the diagram types present in UML. SLIDE BUILDS: None SLIDE SCRIPT: The UML’s structural diagrams exist to visualize, specify, construct and document the static aspects of the system. Think of these as a relatively stable skeleton and scaffolding for the system. The structural diagrams are to a software system what walls, doors, windows, and pipes are to a house. The UML’s five behavioral diagrams are used to visualize, specify, construct and document the dynamic aspects of a system. Just as the dynamic aspects of a house encompass airflow and traffic through the rooms of a house, so too do the dynamic aspects of a software system encompass such things as the flow of messages over time and the physical movement of components across a network. SLIDE TRANSISTION: Class Diagram.
11
使用 UML 类图 search searchresults «uses» «uses» default categories book
2018年11月28日7时21分 使用 UML 类图 search searchresults «uses» «uses» default categories book «uses» «uses» KEY MESSAGE: Class Diagrams in UML. SLIDE BUILDS: None SLIDE SCRIPT: A class diagram shows a set of classes, interfaces, and collaborations and their relationships. Class diagrams are the most common diagram found in modeling object-oriented systems. You use class diagrams to illustrate the static design view of a system. Here is an example of a class diagram from the duwamish sample application that we will be looking at throughout this presentation. In this particular case we see the relationships present between the class that makes up the code for the default web page of the site and the classes that it is uses. For example the default web page uses the search class and it’s functionality as well as the categories class and it’s functionality. These classes in turn utilize two other classes. Class diagrams commonly contain the following things: Classes Interfaces Collaborations Dependency, generalization, and association relationships SLIDE TRANSISTION: Use Case Diagrams in UML.
12
Customer Account Management Product Catalog Search
2018年11月28日7时21分 使用 UML 用例(Use Case) 图 Customer Account Management 用例通常用于: 对系统的前后关联建模 对系统的需求建模 Internet Customer Purchase Books KEY MESSAGE: Use Case Diagrams in UML. SLIDE BUILDS: None SLIDE SCRIPT: A use case diagram shows a set of use cases and actors (a special kind of class) and their relationships. You apply use case diagrams to illustrate the static use case view of a system. Use case diagrams are especially important in organizing and modeling the behaviors of a system. SLIDE TRANSISTION: Class Diagram. Product Catalog Search
13
使用 UML 构件(Component) 图 构件图通常用于: 对源代码建模 对可执行体的发布建模 对物理数据库建模 对可适应的系统建模
2018年11月28日7时21分 使用 UML 构件(Component) 图 构件图通常用于: 对源代码建模 对可执行体的发布建模 对物理数据库建模 对可适应的系统建模 KEY MESSAGE: Component Diagrams in UML. SLIDE BUILDS: None SLIDE SCRIPT: A component diagram shows a set of components and their relationships. You use component diagrams to illustrate the static implementation view of a system. Component diagrams are related to class diagrams in that a component typically maps to one or more classes, interfaces, or collaborations. In this particular example we see a subset of a larger component diagram from the duwamish sample application. In this particular case we see that the Web component is related to the Business Façade and SystemFramework components of the system. SLIDE TRANSISTION: Deployment Diagrams. Web SystemFramework Business Facade
14
使用 UML 实施(Deployment)图
2018年11月28日7时21分 使用 UML 实施(Deployment)图 实施图通常用于: 对嵌入式系统建模 对客户/服务器系统建模 对完全分布式系统建模 DataAccess Database Server KEY MESSAGE: Deployment Diagrams in UML. SLIDE BUILDS: None SLIDE SCRIPT: A deployment diagram shows a set of nodes and their relationships. You use deployment diagrams to illustrate the static deployment view of an architecture. Deployment diagrams are related to component diagrams in that a node typically enclose one or more components. Here we see an example of how some of the different components that relate to data access for the duwamish sample application are intended to be deployed. This is obviously just a subset of what is in reality a much larger diagram. SLIDE TRANSISTION: Sequence Diagrams. Database
15
: BusinessFacade::ProductSystem GetBooksByNaturalLanguage()
使用 UML 顺序(Sequence) 图 2018年11月28日7时21分 顺序图通常用于: 按照时间顺序对控制流建模 : Web::book : BusinessFacade::ProductSystem : DataAccess::Books GetBooksByISBN() GetBooksByAuthor() GetBooksByNaturalLanguage() KEY MESSAGE: Sequence Diagrams in UML. SLIDE BUILDS: None SLIDE SCRIPT: A sequence diagram is an interaction diagrams that emphasizes the time ordering of messages. A sequence diagrams shows a set of objects and the messages sent and received by those objects. The objects are typically named or anonymous instances of classes, but may also represent instances of other things, such as collaborations, components, and nodes. You use sequence diagrams to illustrate the dynamic view of a system. In this particular example we see a portion of a sequence diagram from the duwamish sample application. Here we see a portion of a sequence diagram related to the search functionality for that particular application. Sequence diagrams allows us to better see the flow of the application. For example we can see from this diagram that the DataAccess layer is not just called directly by the Business Façade Component but also directly by the Web Component of the system. SLIDE TRANSISTION: Collaboration Diagrams. GetBooksBySubject() GetBooksByTitle() GetBookById()
16
使用 UML 其他类型图表 协作(Collaboration)图通常用于: 状态(State chart) 图通常用于:
2018年11月28日7时21分 使用 UML 其他类型图表 协作(Collaboration)图通常用于: 按照组织对控制流建模 状态(State chart) 图通常用于: 对反应型对象建模 活动(Activity)图通常用于: 对工作流建模 对操作建模 KEY MESSAGE: Collaboration Diagrams in UML. SLIDE BUILDS: None SLIDE SCRIPT: A collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. A collaboration diagram shows a set of objects, links among those objects, and messages sent and received by those objects. The objects are typically names or anonymous instances of classes, but may represent instances of other things, such as collaborations, components, and nodes. You use collaboration diagrams to illustrate the dynamic view of a system. A State chart diagram is a representation of a “state machine”. In other words it is the representation of the states, events, and transitions that an object goes through in it’s lifetime. An activity diagram shows the flow from activity to activity within a system. An activity shows a set of activities, the sequential or branching flow from activity to activity, and objects that act and are acted upon. You use activity diagrams to illustrate the dynamic view of a system. Activity diagrams are especially important in modeling the function of a system. Activity diagrams emphasize the flow of control among objects. SLIDE TRANSISTION: UML Building blocks.
17
使用 UML 构造块(Building Blocks)
2018年11月28日7时21分 使用 UML 构造块(Building Blocks) 元素 一个模型中最基本的构造块 关系 事物之间的联系 图 一组元素的图形表示 KEY MESSAGE: 3 Fundamental Building blocks exist in UML. SLIDE BUILDS: None SLIDE SCRIPT: UML diagrams generally consist of three fundamental building blocks. First there are elements. These are the basic building blocks of a model. For example a class would be a basic element. Second there are relationship objects that tie things together in the diagram. Finally there are many different diagram types we will be looking at each of these pieces of UML in turn in the upcoming slides. There are four sub-types of elements in UML. We will be looking at each of these in turn in the upcoming slides. SLIDE TRANSISTION: Structural Elements
18
使用 UML 类 每个类都必须有一个名字,以同其它类区分. 属性(Attributes) 描述一个类的实例可以拥有的一组值
2018年11月28日7时21分 使用 UML 类 每个类都必须有一个名字,以同其它类区分. 可能包含路径的名称,用以表示该类存在的地方 Business rules::Customer (“Customer” 类存在于 “Business rules” 包中.) 属性(Attributes) 描述一个类的实例可以拥有的一组值 操作是一个服务的实现,该服务可以由类的任何对象请求以影响其行为 KEY MESSAGE: Classes in UML. SLIDE BUILDS: None SLIDE SCRIPT: Classes in the UML diagram are one of the key building blocks of the model. Each class must have a name to distinguish it from other class. In addition a path may be included so as to specify where a class lives. Attributes allow you to specify the range of values that an instance can hold. Finally operations can be specified. Operations can be defined as Property Procedures, Event Procedures, Methods, etc. SLIDE TRANSISTION: UML Classes Name Attributes Operations
19
使用 UML 依赖关系 依赖是一种使用关系,它说明一个事物规范的变化可能影响到使用它的另一个事务,但反之则不然
2018年11月28日7时21分 使用 UML 依赖关系 依赖是一种使用关系,它说明一个事物规范的变化可能影响到使用它的另一个事务,但反之则不然 在本例中, “Window” 类依赖于 “Event”类. Window Event KEY MESSAGE: Dependency Relationships in UML. SLIDE BUILDS: None SLIDE SCRIPT: Relationships specify how different parts of the model interact. Generalization, Dependency, and Association relationships are the types of relationships that you can create in UML. We will be looking more at relationships later in this presentation. Dependency relationships allow you to specify that a change in a parent object may effect a change in a child object but not the opposite. In the case in the slide Window Depends on the class event. SLIDE TRANSISTION: Generalization Relationships +Open() +Close() +Move() +Display() +handleEvent()
20
使用 UML 泛化(Generalization)/继承(Inheritance) 关系
2018年11月28日7时21分 使用 UML 泛化(Generalization)/继承(Inheritance) 关系 泛化指把一般类连接到较为特殊的类,也称为超类/子类关系或父类/子类关系 KEY MESSAGE: Generalization Relationships in UML are the basis for describing inheritance relationships. SLIDE BUILDS: None SLIDE SCRIPT: Generalization relationships specify that a sub-class is a specialization of a parent class. For example a base stream class might form the foundation for numerous other classes such IOStream, NetworkStream, MemoryStream etc as found in the System.IO namespace in the .NET framework. Another example of generalization would be a base shipper class that contains methods, properties, events, etc that other shipper classes (CareAir, AllAir, etc.) inherit from. The example we have here is taken from the Duwamish sample application which we are looking at in some of the demonstrations in this presentation. The specific example on this slide represents the inheritance relationship of a pagebase class that all the web pages in the duwamish application inherit from. This base class gives each page access to some specific properties and methods. For example there is a property that retrieves the current customer information and populates a DataSet with the information. In addition the base class handles the creation and retrieval of a shopping cart object for the application. SLIDE TRANSISTION: Association Relationships
21
使用 UML 关联(Association)关系
2018年11月28日7时21分 使用 UML 关联(Association)关系 是一种结构关系,它指明一个事物的对象与另一个事务的对象间的联系 关联可以有 名称 角色 多重性 Person Company Works For Name Person Company Employee Employer Role KEY MESSAGE: Association allows you to relate objects that are tied together but are not part of the same inheritance relationship. SLIDE BUILDS: None SLIDE SCRIPT: You can give an association a name, and use that name to describe the nature of the relationship. You can give the name a direction to avoid ambiguity. When a class participates in an association, it has a specific role that it plays in the relationship. You can name the roles of an association. An association represents a structural relationship among object. It can be important to state how many objects may be connected across the association. In this case, each Person can have any number of Companies associated with it, but each Company must have one or more employees. SLIDE TRANSISTION: Diagram Types in UML. Person Company Employee Employer 1 * * Role w/Multiplicity
22
2018年11月28日7时21分 使用 UML 演示 #1 KEY MESSAGE: Part I of the Working with UML Demonstration. SLIDE BUILDS: None SLIDE SCRIPT: In this demonstration we are going to work through two UML diagram types Sequence and Use Case Diagrams. We will then in an upcoming demonstration work with a few more of the UML diagram types. SLIDE TRANSISTION: Class Diagram.
23
议程 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分 KEY MESSAGE: Agenda
SLIDE BUILDS: None SLIDE SCRIPT: In this session we will be covering the Enterprise Architect’s code generation features. We will also be looking at the specific preferences that can be set for generating code in VB.NET and C#. Lastly, we will use the Enterprise Architect tools for error checking our UML models. SLIDE TRANSISTION: Code Generation
24
生成代码 企业架构版可以: 对某个类生成代码 将生成的代码作为新项目的一部分 用一种特定的语言生成代码: 使用代码模板生成代码
2018年11月28日7时21分 生成代码 企业架构版可以: 对某个类生成代码 将生成的代码作为新项目的一部分 Windows® Forms, ASP .NET, Class Library, Web Service, etc. 用一种特定的语言生成代码: C# C++ Visual Basic .NET 使用代码模板生成代码 KEY MESSAGE: Generating code from UML diagrams. SLIDE BUILDS: None SLIDE SCRIPT: Enterprise Architect provides a very powerful yet flexible way to turn your UML diagrams into code skeletons. Generated code can be based on one or more classes from your model and can be created as part of an existing project or as a stand alone file. One of the best new features is the ability to choose whether you want your code generated in C#, C++ or VB.NET. Finally, code templates can be used to control the format of the generated output and maintain consistency. At the time that you generate the code from your UML diagram, Visio allows you to target some or all of your classes , select your target language, and specify the destination of the output files. SLIDE TRANSISTION: Code generation setup window
25
生成代码 操作 操作可以生成为: 可以为每个生成的类文件指定路径 预览选项可以让你查看将要生成的代码
2018年11月28日7时21分 生成代码 操作 操作可以生成为: 属性(Property ) 过程(Procedure ) 事件(Event ) 构造函数或者淅构函数 可以为每个生成的类文件指定路径 预览选项可以让你查看将要生成的代码 用于类 Classes, 属性 Attributes, 操作Operations,等的代码模板 KEY MESSAGE: Operations overview. SLIDE BUILDS: None SLIDE SCRIPT: An operation in your UML diagram can be generated as a property, procedure, function, event, constructor or destructor. This is determined by the code generation preferences you specify on your operations. For example, if you have an operation that represents a property, and you want to create VB.NET code for it, simply set the code generation language and operation kind properties to specify this. When you generate the code, Visio will create a property procedure for you using the correct VB.NET syntax. Preferences can also be set to specify the name and location of generated code. The preview code option allows you view the code before you actually generate it. This allows you the opportunity to “tweak” your preferences to generate code that more closely resembles the desired output. Visio 2002 enables you to customize the generated output at the operation level. In one dialog window, you can set up operation parameters, data types, code generation preferences, and even view the resulting code. Visio 2002 offers a number of code templates that can be used to customize your generated output. Templates can be applied to Classes, Attributes and Operations. It can be used as is, or edited to reflect company standards for documentation and logical ordering of code sections like variables and constants. SLIDE TRANSISTION: Generating code - error checking
26
生成代码 错误检查 UML 图会检查下述两种类型的错误: 语义错误包括图表相关遗漏和未完成的信息 代码错误包括能够导致代码编译失败的错误
2018年11月28日7时21分 生成代码 错误检查 UML 图会检查下述两种类型的错误: 语义 代码 语义错误包括图表相关遗漏和未完成的信息 代码错误包括能够导致代码编译失败的错误 KEY MESSAGE: Error checking overview. SLIDE BUILDS: None SLIDE SCRIPT: Visio 2002 has built-in error checking capabilities that will catch both programmatic and semantic errors. Programmatic errors include things like attributes or operations without name properties, or defining incompatible data types for a generated language. For instance, Visio would generate a code error if an attribute with a data type of C++ unsigned integer exists in a class to be generated in VB.NET. Visio attempts to convert the unsigned integer, but cannot find a compatible VB.NET type. Semantic errors include syntax errors such as missing data or improper use of the UML notation. Duplicate class names and relationships that do not connect to any other objects are examples of semantic errors. Error checking your UML diagram with Visio 2002 can be done automatically or manually through a menu command, depending on your needs. Code checking can be invoked manually or will be done automatically when you attempt to generate code from a UML diagram. Semantic error checking can be set up to run automatically, invoked manually through a menu command, or will be done automatically when you export your diagram. Once Visio locates the errors in your diagram, it highlights the offending object in red, and lists all error messages in the Output window. From the Output window, you can quickly locate the source of the errors by double clicking on each message. It’s that easy. SLIDE TRANSISTION: Demo.
27
2018年11月28日7时21分 生成代码 演示 #2 KEY MESSAGE: Code generation and error checking demo SLIDE BUILDS: None SLIDE SCRIPT: In this demo, we will demonstrate the Enterprise Architect’s code generation features. We will use the provided preference options to generating code in both VB.NET and C#. Lastly, we will demonstrate Enterprise Architect’s tools for error checking UML models. SLIDE TRANSISTION: Reverse engineering code
28
议程 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分 KEY MESSAGE: Agenda
SLIDE BUILDS: None SLIDE SCRIPT: The Visual Studio.NET Enterprise Architect allows you to reverse engineer your Visual Basic.NET, C# and C++ class definitions from existing code into a new UML Model. You can then use the imported class objects in your UML diagrams without having to enter any of the class information. Visio has already done that for you. SLIDE TRANSISTION: Reverse Engineering Basics
29
反向工程 集成到了 Visual Studio® .NET 企业版开发环境中 指定路径和文件名 会创建新的 Visio 模型
2018年11月28日7时21分 反向工程 集成到了 Visual Studio® .NET 企业版开发环境中 Project | Visio UML | Reverse Engineer Visio UML Add-in toolbar button 指定路径和文件名 会创建新的 Visio 模型 可以马上在图中使用这些类 Visio 图被加入到解决方案中 KEY MESSAGE: Visual Studio.NET Enterprise Architect Edition offers the ability to reverse engineer existing projects into UML models. SLIDE BUILDS: None SLIDE SCRIPT: The ability to reverse engineer your class definitions into UML models is built directly into the Visual Studio.NET Enterprise Architect Edition. You access this feature directly from the Visual Studio.NET IDE. Simply highlight the project you wish to reverse engineer and select the Projects | Visual UML | Reverse Engineer menu. Visual Studio.NET will then generate a UML model that you can open and navigate in Visio This model will contain complete class definitions imported from your project code that can be used in your diagrams as needed. The reverse engineering feature is available for C#, C++ and VB.NET. Any class variables, attributes, methods and even references for the classes will be imported to the Visio model as well. This can save a developer a lot of keystrokes, and prevent typos and omissions of important class information. SLIDE TRANSISTION: Demo
30
反向工程 演示 #3 2018年11月28日7时21分 KEY MESSAGE: Reverse Engineering Demo
SLIDE BUILDS: None SLIDE SCRIPT: In this demonstration, we will reverse engineer a class written in VB.NET. We will also look at the classes that are created in Visio and how easily we can use them to create a static structure diagram. SLIDE TRANSISTION: Generating Reports
31
议程 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分 KEY MESSAGE: Agenda
SLIDE BUILDS: None SLIDE SCRIPT: The Visual Studio.NET Enterprise Architect provides a user with the ability to generate detailed reports based on their UML models and diagrams. These reports can be customized for both presentation and content. In addition, Visio 2002 offers an additional feature that allows you to export your UML Model to the web. SLIDE TRANSISTION: UML Reporting Basics
32
生成报表 UML | Reports 菜单 可以生成各种不同的,丰富的报表 报表是可以定制的 静态结构 状态图 构件 实施 活动
2018年11月28日7时21分 生成报表 UML | Reports 菜单 可以生成各种不同的,丰富的报表 静态结构 状态图 构件 实施 活动 报表是可以定制的 KEY MESSAGE: UML Reporting Basics SLIDE BUILDS: None SLIDE SCRIPT: The Visual Studio.NET Enterprise Architect can report on the contents of your UML models and diagrams. Report templates are available for Static Structure, State Chart, Component, Deployment and Activity diagrams. This tool is easily accessible through the UML | Reports menu. Your UML reports can be customized to present the data in a format that you specify. You can update the report titles and subtitles, insert detail fields such as file name, author name, date and time, and even limit the detail of the information being presented. Depending on your needs, you can indicate that the report should contain code generation details, constraints, documentation attached to your UML objects, and any tagged values associated with them. You can make the report as general or as detailed as you want. SLIDE TRANSISTION: Customizing report contents
33
生成报表 报表内容 可以指定报表的范围 指定对象种类以包括 可以为每个新的模型,包,构件选择定制的分隔符 UML 报表可订制 可以基于:
2018年11月28日7时21分 生成报表 报表内容 可以指定报表的范围 可以基于: 活动图 整个 UML 模型 指定对象种类以包括 每个报表都有它自己的类别 每个种类都有它自己的详细级别 可以为每个新的模型,包,构件选择定制的分隔符 UML 报表可订制 KEY MESSAGE: Customizing report contents SLIDE BUILDS: None SLIDE SCRIPT: Visio 2002 also allows you a great degree of control over the contents of your UML reports. You can limit the scope of the report to include only the items within the active diagram or you can report on all of the objects within the UML model. For each type of report, there are certain subcategories of items that you may include in the output. For an even deeper level of detail, you can indicate for each category, which properties should be included as well. We will see an example of this in the next slide. Lastly, you can make the report more readable by adding or removing separators between new logical groups of data. The UML Component Advanced Options window allows you to set the level of detail that you want included in the report. You can select the object categories to be included, as well as include or exclude the individual properties for each of those categories. The Separator section can be used to increase the readability of your report. This is especially important if you are basing your report on a UML Model that includes a large number of objects. SLIDE TRANSISTION: Exporting your reports.
34
生成报表 其它报表选项 从 UML 报表窗口, 可以: 打印 预览 导出 标准打印选项 指定文件名称和位置 RTF 格式
2018年11月28日7时21分 生成报表 其它报表选项 从 UML 报表窗口, 可以: 打印 标准打印选项 预览 导出 指定文件名称和位置 RTF 格式 KEY MESSAGE: Additional Reporting Options SLIDE BUILDS: None SLIDE SCRIPT: Visio 2002 offers you several additional options for your reports. You can print your report with the standard print options you find in any Office tool. You may preview the report with the current customizations. This can allow you to tweak the report until you get just the information that you are looking for. Lastly, you can export your report to a rich text format document that can be opened by just about any word processor. If you need something a little more accessible than that, Visio offers an even better feature for report sharing… SLIDE TRANSISTION: Exporting to the web.
35
生成报表 导出到 Web 将 UML 图表存储为 web 页 很容易的将信息发布到Intranet HTML 帧格式 方便的浏览多个图表
2018年11月28日7时21分 生成报表 导出到 Web 将 UML 图表存储为 web 页 HTML 帧格式 方便的浏览多个图表 可以将图表嵌入到现有的框架中 添加导航条 显示公司信息,标志 使用模板来保证一致性 很容易的将信息发布到Intranet KEY MESSAGE: Exporting diagrams to the web. SLIDE BUILDS: None SLIDE SCRIPT: Exporting your UML models and diagrams to a corporate intranet is easy. Visio allows you to simply save your diagram files as a web page. Visio then converts your drawings to HTML and embeds them as frames within a web page. This web page may contain other elements such as company logos, navigation bars, and additional text or graphics. Best of all, the diagram frame tags are customizable just as any HTML element would be. You can even imbed the diagram within a company’s web template as you would any image to enforce a consistent look with the rest of the company’s web site. There are additional attributes that you can specify for your web page. You can change the page title and filename, or specify more precise attributes of the Web page. They are accessed by clicking the Publish button while you are in the Save As web page dialog. Here, you can specify general page options, appearance attributes and file specifications. The web publishing options tabs cover file, appearance, and general specifications for the page. Under the general tab you can choose specific diagrams to include in the output, indicate whether or not to display the property viewer, include page tabs for navigation between multiple diagrams and use the Format Options dialog to provide alternate file formats for older browsers. The appearance tab can be used to specify a target monitor resolution and to specify any themes that you would like applied to your diagrams. The Files tab is used to indicate whether to use long file names and how to save supporting files. All of the diagrams specified have been added to the web page in their own frame. Navigation is made possible through the tabs along the bottom of the web page. Note that you can even control the size of the diagrams, currently it is set to fit in the current window.
36
生成报表 演示 #4 2018年11月28日7时21分 KEY MESSAGE: Reporting Demo
SLIDE BUILDS: None SLIDE SCRIPT: In this demonstration, we will show you how to create reports based on your UML diagrams as well as the model. We will preview our first report and then export it to rich text format. Second, we will demonstrate how to publish a set of UML diagrams to a web page and view them within a browser. SLIDE TRANSISTION: Session summary
37
总结 建模 使用UML 生成代码 对代码进行反向工程 生成报表 2018年11月28日7时21分
KEY MESSAGE: Session Summary SLIDE BUILDS: None
38
MSDN 开发员最好的和必备的资源 站在微软技术最前沿! 为开发者创建的网络 提供一年12期的光盘资料 分三个级别 目的:
2018年11月28日7时21分 MSDN 开发员最好的和必备的资源 为开发者创建的网络 提供一年12期的光盘资料 分三个级别 开发库—最新的开发文档,示例代码 专业版—开发库+全部微软操作系统+SDK+DDK 宇宙版—专业版+其他所有微软产品 目的: 为开发人员提供最先进的技术资料,产品,并提供相互帮助的机会 MSDN,即微软开发人员网络。实行年度会员制,分为三个版本,详见slide。 按月更新,保证用户能够及时拿到最新的产品与技术文档。 重点介绍宇宙版,包括全部技术文档,所有的微软已发布软件以及最新软件 的测试版。全年的费用为29,000元人民币。如果购买宇宙版,我们保证用户 在这一年里将站在微软技术的最前沿。 MSDN的目的:给程序员一个完整的学习和测试环境,所有的正版产品不能用 于商业用途。 享受特殊会员服务: 会员卡 CTEC SD培训(两门,八折) 免费PDC, Devday, TechED 门票 电话服务(两月一次) 会员邮包(每季) 会议中专门服务 优惠购买微软出版社图书 网站服务 站在微软技术最前沿!
39
调用WEB服务,获得酷鼠滑板 用任何语言创建一个任何类型的程序 添加一个Web引用
2018年11月28日7时21分 调用WEB服务,获得酷鼠滑板 用任何语言创建一个任何类型的程序 添加一个Web引用 设置好各项参数(CdKey, sName, …)然后调用Register() using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using RegClient.localhost; namespace RegClient { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form private System.Windows.Forms.Button button1; /// Required designer variable. private System.ComponentModel.Container components = null; public Form1() // // Required for Windows Form Designer support InitializeComponent(); // TODO: Add any constructor code after InitializeComponent call } /// Clean up any resources being used. protected override void Dispose( bool disposing ) if( disposing ) if (components != null) components.Dispose(); base.Dispose( disposing ); #region Windows Form Designer generated code /// Required method for Designer support - do not modify /// the contents of this method with the code editor. private void InitializeComponent() this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // button1 this.button1.Location = new System.Drawing.Point(168, 56); this.button1.Name = "button1"; this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.Click += new System.EventHandler(this.button1_Click); // Form1 this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(292, 273); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.button1}); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); #endregion /// The main entry point for the application. [STAThread] static void Main() Application.Run(new Form1()); private void button1_Click(object sender, System.EventArgs e) RegType rt = new RegType(); Service1 svc = new Service1(); rt.sCDKey = "CDKey1"; rt.sName = "姓名1"; rt.sPhone = "phone1"; rt.s = rt.sAddress = "address1"; rt.sCity = "city1"; rt.sCountry = "country1"; rt.sCitizenID = "id1"; bool bRet = svc.Register(rt); 请访问 获得详细信息
40
参与世界大赛,总奖金$400000美元 编写一个Web服务的应用,并注册到UDDI服务器 一个小建议:可以对现有站点包装
2018年11月28日7时21分 参与世界大赛,总奖金$400000美元 编写一个Web服务的应用,并注册到UDDI服务器 一个小建议:可以对现有站点包装 请访问 获得详细信息 using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using RegClient.localhost; namespace RegClient { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form private System.Windows.Forms.Button button1; /// Required designer variable. private System.ComponentModel.Container components = null; public Form1() // // Required for Windows Form Designer support InitializeComponent(); // TODO: Add any constructor code after InitializeComponent call } /// Clean up any resources being used. protected override void Dispose( bool disposing ) if( disposing ) if (components != null) components.Dispose(); base.Dispose( disposing ); #region Windows Form Designer generated code /// Required method for Designer support - do not modify /// the contents of this method with the code editor. private void InitializeComponent() this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // button1 this.button1.Location = new System.Drawing.Point(168, 56); this.button1.Name = "button1"; this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.Click += new System.EventHandler(this.button1_Click); // Form1 this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(292, 273); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.button1}); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); #endregion /// The main entry point for the application. [STAThread] static void Main() Application.Run(new Form1()); private void button1_Click(object sender, System.EventArgs e) RegType rt = new RegType(); Service1 svc = new Service1(); rt.sCDKey = "CDKey1"; rt.sName = "姓名1"; rt.sPhone = "phone1"; rt.s = rt.sAddress = "address1"; rt.sCity = "city1"; rt.sCountry = "country1"; rt.sCitizenID = "id1"; bool bRet = svc.Register(rt);
41
2018年11月28日7时21分 Questions And Answers
Similar presentations