【软件分析设计与建模】期末复习

选择题

1, UML 各种图的定义

1) usecase diagram

【A use case models a dialog between actors and the system.

A use case is initiated by an actor to invoke a certain functionality in the system.】

2)Activity diagram

【An activity diagram in the use-case model can be used to capture the activities in a use case.

It is essentially a flow chart, showing flow of control from activity to activity.】

3) sequence diagram

【A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.】

4) Collaboration diagram

【A collaboration diagram emphasizes the organization of the objects that
participate in an interaction.】

5) class diagram

【Static view of a system. Include The vocabulary of a system, Collaborations, A logical database schema.】

6) statechart diagram

【A statechart diagram shows a state machine.】

7) deployment diagram

【The deployment diagram shows:

Configuration of processing nodes at run-time.

Communication links between these nodes.

Component instances and objects that reside on them.】

2,Why the system should be layered/h3>

3,waterfall

Waterfall is conceptually straightforward because it produces a single deliverable. The fundamental problem of this approach is that it pushes risk forward in time when it is costly to undo mistakes from earlier phases. An initial design will likely be flawed with respect to its key requirements, and furthermore, the late discovery of design defects tends to result in costly overruns and/or project cancellation. The waterfall approach tends to mask the real risks to a project until it is too late to do anything meaningful about them.
【瀑布在概念上是直接的,因为它产生一个单独的可交付成果。这种方法的基本问题是,当撤销早期阶段的错误代价很高时,它及时地推进了风险。最初的设计很可能在其关键需求方面存在缺陷,而且,设计缺陷的后期发现往往会导致昂贵的超支和/或项目的取消。瀑布方法倾向于掩盖项目的真正风险,直到为时已晚,无法对其做任何有意义的事情。】

4,UP (Unified process)

①Six Best
Practices

Develop Iteratively 迭代

Manage Requirements 需求

Use Component Architectures 组合

Model Visually 模型

Verify Quality 质量

Control Changes 变化

②UP Structure(4 phases + 9 workflows)

The Unified Process has 4 phases:

Inception – 【approximate vision, business case, scope, vague estimates】

Elaboration -【refined vision, iterative implementation of the core architecture, resolution of high risks, identification of most requirements and scope, more realistic estimates. 】

Construction – 【product the program,iterative implementation of the remaining lower risk and easier elements, and preparation for deployment】

Transition – 【Transition the product into end user community,beta tests, deployment】

③Characteristics

Use-case driven

Architecture centric

Iterative and incremental

5,UML类图中的六大关系

【软件分析设计与建模】期末复习

· (关联)Association:A类有B类有逻辑上的连接
【 关联描述两个类之间行为的一般二元关系。例如,一个学生选修一门特定的课程是学生类Student和课程类Course之间的一个关联,而一个教师教授一门课程是师资类Faculty和课程类Course之间的一个关联。Java代码中,关联可以用属性和方法来实现。】

· (聚合)Aggregation : A类有一个B类(B is a part of A)
【聚合是一种特殊的关联(Association)形式,表示两个对象之间的所属(has-a)关系】

· (组合)Composition : A类拥有一个B类(B is a part of A)
【 聚合是一种较弱形式的对象包含(一个对象包含另一个对象)关系。较强形式是组合(Composition). 在组合关系中包含对象负责被包含对象的创建以及生命周期,即当包含对象被销毁时被包含对象也会不复存在。例如一辆汽车拥有一个引擎是汽车类Car与引擎类Engine的组合关系。】
1)通过成员变量初始化

2)通过构造函数初始化

3)通过延迟初始化

· (依赖)Dependency : A类使用了B类( A use B)
【依赖(Dependency)描述的是一个类的引用用作另一个类的方法的参数。例如,可以使用Calendar类中的setTime(Date date)方法设置日历,所以Calendar和Date之间的关系可以用依赖描述】

· (继承)Inheritance : B类是一个A类 (或者B类扩展A类)(B is a A)
【继承(Inheritance)模拟两个类之间的is-a关系。强是(strong is-a)关系描述两个类之间的直接继承关系。弱是(weak is-a)关系描述一个类具有某个属性。强是关系可以用类的继承表示。例如,Spring的ApplicationEvent是一个EventObject,ApplicationEvent和EventObject间就是一种强是关系,可以用继承描述。】

· (实现)Realization : B类实现了接口A(realize)
【实现(Realization)描述的是一个类实现了接口(可以是多个)。上面描述的弱是(weak is-a)关系就可以用接口表示。例如字符串是可以被序列化的,这就可以用实现来描述。】

6,GRASP

pattern

pattern is a named description of a problem and solution that can be applied to new contexts

creater

Who should be responsible for creating a new instance of some classbr> solution:
Assign class B the responsibility to create an instance of class A

if one of these is true (the more the better): ?
·B “contains” or compositely aggregates A. ?
·B records A. ?
·B closely uses A. ?
·B has the initializing data for A that will be passed to A when it is created.
Thus B is an Expert with respect to creating A.

B is a creator of A. If more than one option applies, usually prefer a class B which aggregates or contains class A.

coupling

?Coupling is a measure of how strongly one object is connected to, has knowledge of, or depends upon other objects. An object A that calls on the operations of object B has coupling to B’s services. When object B changes, object A may be affected
Benefits of making classes independent of other classes ?
·changes are localized ?
·easier to understand code ?
·easier to reuse code

Cohesion

Cohesion is a measure of how strongly related and focused the responsibilities of an element are
Solutions: ?Assign a responsibility so that cohesion remains high. Use this to evaluate alternative
Rule of thumb: ?
a class with high cohesion has a relatively small number of methods, with highly related functionality, and does not do too much work.

information expert

?Benefits: ?Information encapsulation
– objects use their own information to fulfill tasks
– supports low coupling ?

Behavior is distributed across the classes that have the required information
– lightweight class definitions – High cohesion

Also Known As ?”Place responsibilities with data,” “That which knows, does,” “Do It Myself,” “Put Services with the Attributes They Work On.”

controller

problem:Who should be responsible for handling an input system eventbr> ?Benefits ?
·Increased potential for reuse, and pluggable interfaces
– No application logic in the GUI
·Dedicated place to place state that belongs to some use case
– E.g. operations must be performed in a specific order

Polymorphism 多态性

Indirection ? 间接性

Pure fabrication ?纯虚构

Protected variations 防止变异

填空题

【软件分析设计与建模】期末复习

简答题

1, What is Object-Oriented Analysis
finding and describing the concepts in (not software object or class) the problem domain.
?OUTPUT:
– The concepts in the domain, the responsibility and the relation of concepts

2, What is Object-Oriented Design
-defining software objects based on the concepts in OOA ?
-defining how the software objects collaborate to fulfill the requirements
3,Domain model ?
identification of the concepts, attributes, and associations that are considered noteworthy
4,interaction diagrams
interaction diagrams is the dynamic view of collaborating objects
5, class diagram
class diagram to illustrates the attributes and methods of the classes .
6,What is UML /strong>
?is a visual language for specifying, constructing and documenting the artifacts of systems
?An industry-standard graphic language to specifying, visualizing, constructing and documenting of software system
7, What is software development process
describes an approach to building, deploying, and possibly maintaining software
8, What is UP(Rational UP)
?popular iterative software development process for building object-oriented systems
9,Waterfall lifecycle
Waterfall
is a linear approach to software development
attempt to define (in detail) all or most of the requirements before programming

Key features of waterfall lifecycle

  1. Many Documents.
  2. Frozen requirement via contract,signed requirements are the basis for all the next works
  3. Completed and detailed plan and budget
  4. Users are the last to see software. users don’t know what they want, but they know what they don’t want when they set it.

Why waterfall lifecycle so failure
?Wrong Assumption 1 : Requirements will be frozen
Wrong Assumption 2 : We can get the right design on paper before processing

10,What is Iterative and Evolutionary Development ?
·development is organized into a series of short, fixed-length (for example, three-week) mini-projects called iterations ?
·successive enlargement and refinement of a system through multiple iterations(通过多次迭代对系统的连续扩展和细化)
11,The result of each iteration is an executable but incomplete system
12,How to estimate the efforts(size) of project/strong>
?·Code Lines, KLOC
·Waterfall lifecycle
– Structured Method
?function point method
– OO Method
? Use case point
? to forecast the software size when theUML are used ?
·Iterative lifecycle
– Use story points to estimate the size of user story.
13,Summary of Iterative lifecycle
?Time-boxed, or fixed in length, time unit is weeks
?Demo-able or shippable build
Evolutionary or (micro-)incremental development
?Iterative development is the core of agile methods.
14,What are Agile Methods
?short timeboxed iterations with evolutionary refinement of plans, requirements, and design is a basic practice the methods
15,The Agile Principles
?Our highest priority is to satisfy the customer through early and continuous delivery of valuable software
?Welcome changing requirements, even late in development
16, What is Agile Modeling
?The purpose of modeling is to understand, not to document
17, What is an UP(Unified Process)
?·UP is one of the Iterative and Evolutionary development
?·Sample structure to apply OOA/D and UML
?·central idea of UP
? short time-boxed iterative, evolutionary, and adaptive development
18, Goal of Operation Contracts
?Define system operations.
?Create contracts for system operations
19, What is a System Operation/strong>
Operation Contracts are de?ned in terms of system operations
Operations (say, methods) that the system offers as a whole
The system is still a black box at this stage
The System Sequence Diagrams show system events
? I.e., the SSD’s messages
System operations handle system events
20,what’s post-conditions/strong>
The post-conditions describe changes in the state of objects in the domain model. Domain model state changes include instances created, associations formed or broken, and attributes changed.
21,Software architecture
Software architecture is the fundamental organization of a system, embodied in its components, their relationships to each other and the environments, and the principles governing its design and evolution.
?Architecture={component, relations, environment, principle}.
22,activity diagram
?shows sequential and parallel activities in a process.
?useful for modeling business processes, workflows, data flows, and complex algorithms

典型例题

1,GRASP低耦合

【软件分析设计与建模】期末复习
【软件分析设计与建模】期末复习 来源:桂花与酒

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年7月8日
下一篇 2020年7月8日

相关推荐