- Consider a class called FileParser which is equipped
with methods for parsing text occurrences like tag = value
in text files
- We now want a class HTMLPage representing an HTML page
with all links
- HTMLPage will need to parse an HTML (text) file to
find links; these are found by looking at occurrences like
HREF="url"
- It is best to keep the text file parsing data/methods and
HTML-specific parts independent
- HTMLPage can inherit the public data/methods
from FileParser:
class HTMLPage : public FileParser {...} ;
Leo Liberti
2008-01-12