COMP2007-Unified modelling language Flashcards

0
Q

UML Diagrams

A

Class diagrams
- describe classes & their relationships

Inreraction diagrams
- show behaviour of sys in terms of how objects interact

State and activity diagrams
- show how systems behave internally

Component and deployment diagrams
- show how sys components are arranged logically & physically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

UML

A

Standard graphical language for modelling oo sw

Not a methodology, assists in dev

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

UML Class diagrams

A

Classes
- represent the types of data themselves

Associations
- linkages btwn instances of classes

Attributes
- simple data found in classes & their instances

Operations
- represent the functions performed by classes & instances

Generalisations
- group classes into inheritance hierarchies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

UML Code

A
------------
| Student |     public class 
------------       Student
| + name |         {
| + ID       |          public int 
========         name;
                          Public int ID;
                         }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Design process affects

A

Development rime

Software quality

Ease of maintenance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

UML models help during different stages and with different purposes

A

Sys analysis model
- during analysis ph to learn bout domain

Sys arch model
- high level abstract classes representing sys arch and interfaces

Detailed des model
- refine analysis model till material in form that can be implemented by programmers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Dinding classes + developing class diagrams

A

Identify classes

Add associations and attributes

Find generalisations

List main responsibilities of each class

Decide on specific operations

Iterate till model ok

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Identifying generalisations & interfaces

A

Find generalisations
- bottom up-group similar to create super class

-top down- look for more general classes 1st, specialise them if needed

Create an interface io super class
If
Classes dissimilar except few common operations
1 or more already have own superclass
Diff implementations of same class might b available
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Coupling & cohesion

Coupling

A

Coupling - number of dependencies between two systems

Loosely coupled systems -> independent; modification to one has little effect on another

Low coupling is good; reduce impact of changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Coupling & cohesion

Cohesion

A

Cohesion refers to dependencies within a module’s internal elements

High cohesion means that the module is focused in purpose, understandable, manageable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Low coupling good

A

High cohesion good

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Coupling

A

Measure of how strongly classes interact

A has an attribute of B
A inherits from B
A calls on the service of a B object
A has a method which references B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Disadvantages of high coupling

A

Change in one class ripples to others

Difficult to understand class in isolation

Difficult to reuse class because dependabt class must also be used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Cohesion

A

Measure of how strongly related and focused the responsibilities of single classes are

It is decreased when;
Responsibilities (operations) of a class have little in common

Operations do many varied activities, often using varied data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Disadvantages of weak cohesion

A

Difficult to understand

Difficult to maintain as constantly affected by changes

Difficult to reuse as most applications wont need a random set of operations attached to a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Class responsibility collaboration cards

A

One per candidate class

Class Superclasses
Subclasses
Responsibilities Collaborations

Using a small card keeps the complexity of design to a minimum

16
Q

Class responsibilities

A

Assign responsibilities to each class based on Services it provides and Data it keeps

  • set & getting values of attributes
  • creating & initialising new instances
  • loading and saving to persistent storage
  • destroying instances
  • copying, concerting, transforming, transmitting or outputting
  • computing numerical results
  • navigating & searching
    Interactions with other classes
    Classes with too many responsibilities should b divided
17
Q

Class responsibility-more consiserations

A
Stereotype of class ("Interface" used in java)
Super/sub class responsibilities
Collaborators
- providing information
- providing a service
Ask
Can this class fulfill this responsibility itself

If not what does it need

From what other class can it acquire what it needs

18
Q

Problem statement

A

Get nouns

Consider them for candidate objects

Get verbs

Consider them for relationships
Also get assumptions-tacit knowledge

19
Q

Make an initial clas diagram

A

Just with boxes with nouns and lines with verbs connecting them

20
Q

Make a sequence diagram

A

Usage scenario

Interaction diagram