Development of a reusable singly linked list. First we need to analyze the requirements different applications might have, such as type of elements, element traversal, storage layout, error detection etc. The different features are documented using feature diagrams. Finally, we should prioritize the features according to project goals.
- External reference
- Owned reference
Implementation using static parameterization. The implementation consists of the following components:
- PtrList: Basic list functionality
- LenList: Wrapper for adding a length counter to a list
- TracedList: Wrapper for adding tracing to a list.
List: TracedList[OptCounterList] | OptCounterList
OptCounterList: LenList[BasicList] | BasicList
TypeChecker: DynamicChecker | EmptyChecker
Copier :PolymorphicCopier|MonomorphicCopier |EmptyCopier
LengthType : int | short | long | …
The implementation components constitute a layered architecture. Each rectangle represents a layer. A layer drawn on top of another layer refines the latter by adding new functionality. A component from one layer takes another component from the layer below as its parameter.
The bottom layer is referred to as the configuration repository. A configuration repository provides types needed by the other layers under standardized names. It works as a kind of registry, which components may use to retrieve configuration information from and also to exchange such information among each other. A configuration repository allows us to separate the configuration knowledge from the components.
Composing List Components
We have to define a configuration repository with the necessary configuration information.