August 1999
Intermediate to advanced
224 pages
4h 25m
English
Several languages, most noticeably C++, have the notion of a parameterized clasys, or template.
This concept is most obviously useful for working with collections in a strongly typed language. This way, you can define behavior for sets in general by defining a template class Set.
class Set <T> {
void insert (T newElement);
void remove (T anElement);
When you have done this, you can use the general definition to make set classes for more specific elements.
Set <Employee> employeeSet;
You declare a parameterized class in the UML using the notation shown in Figure 6-18.
The T in the diagram ...
Read now
Unlock full access