• No results found

Example Project

5.1 Initial Situation in 2001

Before the introduction of the MAXI Cheetah to the market in 2001, the technical press praises the prototype of the car for its technical reliability at a relatively low price. The management of MAXI decides that these characteristics make the car a first class choice for young people.

In order to increase sales, the company wants to accomodate this target group by providing all cars with a multimedia system that can be configured to only include required devices and thus further reduce costs.

One elementary part of the system is the on board computer which collects and displays vehicle data. It receives data from multiple sensors in the car, for example from the engine. The information gathered is then used to calculated values such as gas consumption. To communicate the calculated values to the driver, the results are visualized on a display in the middle console of the car. The on board computer is an integral part of car functionality as it is also used for internal error diagnosis. Thus, it is included in every configuration of the MAXI Cheetah.

Figure 5.1: Feature tree of the automotive multimedia product line in 2001.

Optionally, customers may decide to include an audio player into their car. Even in its most basic variant, the audio system features an FM/AM band radio tuner used to receive radio broadcasts around the world. Furthermore, it is possible to buy upgrades to play various media on the audio system. In particular, a cassette or CD player may be installed. Both these upgrades are independent of one another and may be bought in combination or individually.

Looking at these configuration options from a software product line perspective creates the feature tree displayed in Figure 5.1.

Besides the feature tree in the problem space, the automotive multimedia product line

fea-tures multiple solution space artifacts. The design of the system is specified in the form of a UML model. Its contents are displayed in Figure 5.2. An essential part of each configuration is the display in the middle console of the car. The class with similar name provides high level methods to visualize graphical information. For example, it allows to draw primitives and bring text to the screen. The class UserInterface is responsible for managing the interaction with users of the car. It contains dialog elements for all present multimedia devices. Due to the complexity of the user interface, the builder pattern [GHJV95] is used to create it. The class responsible for assembly is UIBuilder. It creates appropriate menus for each of the mutlimedia devices. However, the user interface built for a particular car depends on the concrete selection of features. For example, if no audio player is included in the multimedia system, the respec-tive menu should not be created either. Thus, the building procedure for the user interface is adapted in the process of creating a particular variant of the product line. At runtime, the created user interface redirects all requests in a particular menu to their respective device. In the case of the on board computer, this logic is represented by the class OnBoardComputer. It collects and evaluates sensor data from the car before visualizing it on the display. The class AudioPlayer uses the display to show information on the currently played music. The class delegates decoding of individual audio sources to specialized classes. For example, the classes CassettePlayer and RadioTuner playback music cassettes digitally and decode radio signals respectively. Equivalent is true for the class CDPlayer and the playback of audio CDs. However, this class has an additional method to decode the CD text information saved on audio CDs, which describes the currently played track and its album. In the case of CDs, this information is displayed on the screen during playback. Naturally, the audio player requires the speaker system of the car to play music. Thus, the class AudioPlayer has an association to the class Speakers, which contains the control logic for the speaker system. Independent of the current audio source, it is possible to regulate the volume level using the volume control represented by the class VolumeControl. These classes of the UML model serve as design blueprints for the implementation in source code.

The multimedia system of the MAXI Cheetah features a Java virtual machine and thus is capable of interpreting byte code. Hence, Java was chosen as the implementation language for the classes described in the UML model. However, implementation details in the source code are neglected for the majority of the classes realizing the specified design to not clutter the explanations. Yet, the class UIBuilder will have its implementation modified as an example of evolutions on Java source code. The source code of the method createUI() of the class UIBuilder is shown in Listing 5.1 as provided with the initial version of the product line.

Besides the design and implementation models, the product line also contains a user manual for the mutlimedia system of the MAXI Cheetah. In its general form, the manual features chapters describing the operation of the on board computer and the audio player. The latter is further divided into sections describing the cassette player, the radio and the CD player.

Customers of the MAXI Cheetah are to be provided with a customized user manual containing only the descriptions of the multimedia devices that were actually built into their car. Thus, the manual has to be adapted in accordance with the concrete selection of features. In the case of the optional features CassettePlayer and CDPlayer, this means that the respective sections have to be removed from the manual if their features were not selected. If customers decide

Figure 5.2: UML diagram for the automotive multimedia product line in 2001.

+createUI() : UserInterface UIBuilder OnBoardComputer CassettePlayer

UserInterface AudioPlayer

+readCDText() CDPlayer

Display RadioTuner

VolumeControl Speakers

<<creates>>

Listing 5.1: Java source code of the method createUI() of the class UIBuilder of the year 2001.

public UserInterface createUI() {

UserInterface ui = new UserInterface();

//build OnBoardComputer menu (block 1) Menu onBoardComputerMenu = new Menu();

onBoardComputerMenu.setName("On Board Computer");

//...

ui.addMenu(onBoardComputerMenu);

//build AudioPlayer menu (block 2) Menu audioPlayerMenu = new Menu();

audioPlayerMenu.setName("Audio Player");

//...

ui.addMenu(audioPlayerMenu);

return ui;

}

not to include the AudioPlayer feature in the configuration of their car, the entire chapter explaning it has to be removed from the user manual. In Listing 5.2, a shortened version of the user manual is shown in the previously introduced DocBooklet format. The complete contents of the user manual of the year 2001 can be found in digital form along with the example project.

Listing 5.2: Shortened version of the MAXI Cheetah user manual of the year 2001.

<?xml version="1.0" encoding="utf−8"?>

<book>

<title>"MAXI Cheetah Manual"</title>

<chapter>

<title>"Audio Player"</title>

<para>"So that you can start..."</para>

<section>

<title>"Radio"</title>

<para>"With your car radio ..."</para>

<para>"Frequency Modulation ..."</para>

<para>"The system runs a ..."</para>

<para>"If a malfunction ..."</para>

</chapter>

</book>

In order to customize the solution space models according to the above specifications, a mapping from feature expressions of the feature tree to the respective parts of the solution space models has to be established. In Table 5.1, all mappings of the 2001 version of the automotive multimedia product line can be seen in an intuitive notation.

With the feature tree, the three solution space models and the mapping between problem and solution space, the 2001 version of the automotive multimedia product line is fully specified.