• Keine Ergebnisse gefunden

Design Patterns Exercise

N/A
N/A
Protected

Academic year: 2022

Aktie "Design Patterns Exercise"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Chair for Applied Software Engineering Prof. B. Brügge, Ph. D.

Software Engineering Exercise, SoSe 2009 Exercise 5 - (due June 3rd)

1/2

Design Patterns Exercise

1) Pattern Abstraction

Figure 1: Notebook power supply

Imagine a notebook power supply (see Figure 1). Discuss the similarities to different patterns used in software engineering. Which pattern fits best? Justify your solution.

2) Validation Controller

Write a validation runner, which iterates through a Unicase project and validates every functional requirement and every use case with your Validator, implemented in Exercise 2. The validation runner returns a set of model elements (functional requirements and use cases) that failed the validation. Write a test case to test the validation runner.

Hint: Project supports a method getAllModelElementsByClass returning all model elements of a certain class in the project. See video tutorial on validation controller for details.

3) Adapter Pattern

a) Validation in Unicase

Unicase has a view to show the result of the build-in validation. You can open it by right- clicking a project and the selecting “Other” => “Validate Project”. Validate your project and try to solve all the resulting warnings.

b) Adapting your Validator

To show a validation warning in the existing view in Unicase, a Validator has to extend the abstract class AbstractModelConstraint. Use the adapter pattern to show the result of the “Weak Phrases”-Validator in the existing Unicase Validation view.

Hint: Watch the video tutorial on validation for details.

(2)

Chair for Applied Software Engineering Prof. B. Brügge, Ph. D.

Software Engineering Exercise, SoSe 2009 Exercise 5 - (due June 3rd)

2/2

4) Observer Pattern

The Observer pattern allows decoupling a class that is being observed from an

observer. In unicase all model elements are contained in a project. To listen to changes on model elements on a project, you can register as ProjectChangeObserver at the project. After registration an observer will subsequently be notified on any change on a model element in the respective project.

Implement a test case where you register as an observer to the project and check whether you are notified when a new functional requirement is added to the project.

Hint: Watch the video tutorial on observer for details.

This exercise is due on June 3rd, however one additional task will be published on exercise sheet 6, so please plan for this!

Referenzen

ÄHNLICHE DOKUMENTE

(19) have therefore introduced a concept of model usefulness and model reliability. Ac- cording to their terminology , a valid model has no be- havior which does

The aim of this paper, threfore, is to present a classifi- cation of models and an analysis of the modeling process from the point of view of model validation.. At this stage of the

This model, which qs being yointly developed-by IIASA and the Operational Research Services of the UK Department of Health and Social Security (DHSS), is designed to predict

The aim of the present study is to build a simplified model for active vibration control with sampling delay of a suspended cable exposed to periodic excitation, and to investigate

In this paper, we show how certain principles which are part of agile software engineering (in particular test- driven software development) can be adapted so that they can be used

This validation study was conducted as part of the larger study that aimed to find out differences of moral judgment competence and moral preferences between students of Public and

Figure 4: Map of the validation publications and their citation scores: (a) According to the total number of

The articles in each topic cite the articles in the same topic most, indicating that the validation literatures of these modeling areas are closed to each other. The