UML Component Diagrams - unibo.it

13
UML Component Diagrams A.Y 2020/2021

Transcript of UML Component Diagrams - unibo.it

Page 1: UML Component Diagrams - unibo.it

UML Component DiagramsA.Y 2020/2021

Page 2: UML Component Diagrams - unibo.it

Problem

● Design a software that: ● reads chromosomes from a dataset and creates corresponding objects,

e.g. Chromosome, SNP, etc. ● computes population statistics, e.g. we have a number of classes that

analyses chromosomes, SNPs with respect to certain criteria associated with the average population

● presents the results of the computation either in a Web browser or in a mobile application

Page 3: UML Component Diagrams - unibo.it

Component diagrams

Component diagrams are integral to building your software system.

Drawn out with UML diagramming software, they help your team understand the structure of existing systems and then build new ones.

Page 4: UML Component Diagrams - unibo.it

What is a UML component diagram?

The purpose of a component diagram is to show the relationship between different components in a system.

The term component refers to a module of classes that represent independent systems or subsystems with the ability to interface with the rest of the system.

Page 5: UML Component Diagrams - unibo.it

The role of component diagrams

There exists a whole development approach that revolves around components: component-based development (CBD). In this approach, component diagrams allow the planner to identify the different components so the whole system does what it's supposed to do.

More commonly, in an OO programming approach, the component diagram allows a senior developer to group classes together based on common purpose so that the developer and others can look at a software development project at a high level.

Page 6: UML Component Diagrams - unibo.it

Benefits of component diagrams

Though component diagrams may seem complex at first glance, they are invaluable when it comes to building your system. Component diagrams can help your team:

- Imagine the system’s physical structure. - Pay attention to the system’s components and how they relate. - Emphasise the service behaviour as it relates to the interface.

Page 7: UML Component Diagrams - unibo.it

How to use component diagrams

A component diagram in UML gives a bird’s-eye view of your software system.

Understanding the exact service behaviour that each piece of your software provides will make you a better developer.

Component diagrams can describe software systems that are implemented in any programming language or style.

Page 8: UML Component Diagrams - unibo.it

What component diagrams are

UML is a set of conventions for object-oriented diagrams that has a wide variety of applications.

In component diagrams, the Unified Modelling Language dictates that components and packages are wired together with lines representing assembly connectors and delegation connectors.

Page 9: UML Component Diagrams - unibo.it

Notation

A component provides and consumes behaviour through interfaces, as well as through other components. Think of components as a type of class.

Shows input or materials that a component either receives or provides.

Page 10: UML Component Diagrams - unibo.it

Provided and required interfaces

Provided interfaces: A straight line from the component box with an attached circle. These symbols represent the interfaces where a component produces information used by the required interface of another component.

Required interfaces: A straight line from the component box with an attached half circle (also represented as a dashed arrow with an open arrow). These symbols represent the interfaces where a component requires information in order to perform its proper function.

Page 11: UML Component Diagrams - unibo.it

Example

Page 12: UML Component Diagrams - unibo.it

Questions

Page 13: UML Component Diagrams - unibo.it

Exercise

Extend the exercise on SNPs [1] in order to add a user interface. The user interface is meant to present the results of the computation on a Web page. The extension should also allow to separate clearly the part of the software meant for reading the dataset from the other parts (i.e. Chromosome and SNP classes). Before coding design your software by means of UML Component as well as class diagrams.

1. https://github.com/anuzzolese/genomics-unibo/tree/master/2020-2021/exercises/snps