Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.3 Abstract and Concrete Classes

This section highlights some common points among the classes in the Essential Tools Module.

The Essential Tools Module provides implementation, not policy. Hence, it consists mostly of a large and rich set of concrete classes that are usable in isolation and independent of other classes for their implementation or semantics. They can be pulled out and used just one or two at a time. Concrete classes are the heart of the Essential Tools Module.

The Essential Tools Module also includes a rich set of abstract base classes, which define an interface for persistence, internationalization, and other issues, and a number of implementation classes that implement these interfaces.

Some Essential Tools Module classes are further categorized as collection classes, or collections, as explained in Section 2.2.4.

Collection classes generally follow the Smalltalk naming conventions and semantical model: SortedCollection, Dictionaries, Bags, Sets, and so on. They use similar interfaces, allowing them to be interchanged easily. The template-based collections will hold any kind of object; the Smalltalk-like collections require that all collected items inherit from RWCollectable.

Choosing which collection classes to use in your programs is not a trivial task. Appendix A can help you decide which class is the best for your purposes. The Classes | Class Hierarchy tab of the SourcePro C++ API Reference Guide shows the class hierarchy of all the public Essential Tools Module classes. In addition to these public classes, the Essential Tools Module contains other classes for its own internal use.

2.3.1 Concrete Classes

The concrete classes consist of:

2.3.1.1 Simple Classes

The Essential Tools Module provides a rich set of lightweight simple classes. By lightweight, we mean classes with low-cost initializers and copy constructors. These classes include RWDateTime for dates and times, with support for various time zones and locales), RWCString (for single and multibyte strings), and RWWString (for wide character strings). Most instantiations of these classes can be stored in four bytes or less, and have very simple copy constructors (usually just a bit copy) and no virtual functions. The SourcePro C++ API Reference Guide provides additional information on these classes.

2.3.1.2 Template-based Collection Classes

Template-based collection classes, or templates, give you the advantages of speed and type-safe usage. When templates are used sparingly, their code size can be quite small. When templates are used with many different types, however, their code size can become large because each type effectively generates a whole new class. If you have the C++ Standard Library, you can use the Essential Tools Module template-based collections that are based on the C++ Standard Library. If you do not have the C++ Standard Library, you can use a subset of the templates, described in Section 6.9.1 and Section 6.14.

2.3.2 Abstract Base Classes

The Essential Tools Module includes a set of abstract base classes and corresponding specializing classes that provides a framework for many issues. The list below identifies some of these issues and associates them with their respective abstract base classes. The description of each class in the SourcePro C++ API Reference Guide indicates whether it is an abstract base class.

Table 1: Abstract base classes and issues

Issue Class Where Discussed
Locale RWLocale Section 7.5
Time zones RWZone Section 7.5
Virtual streams RWvistream RWvostream Chapter 5
Polymorphic persistence RWCollectable Chapter 8
Virtual page heaps RWVirtualPageHeap Reference Guide
Model-View-Controller abstraction RWModel RWModelClient Reference Guide


Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.