Importance of the Interface Segregation Principle
Understand the importance of the interface segregation principle with an example.
We'll cover the following...
We'll cover the following...
Example of the interface segregation principle
The following playground contains a console application that reads text from a file and converts it to HTML:
Note: Run the following code. The program will ask for the file to convert. Enter
sample.txtas the name of the file. When the program stops execution, press any key to return to the terminal. Now, enter thecat sample.htmlcommand to see the content after conversion.
This is the first paragraph. It has *bold text*. This is the second paragraph. It has **italic text**. This is the third paragraph. It has ~~text with strike-through~~.
Initial project setup
We have a TextProcessor named base class on lines 6–23 in the code provided below that converts paragraphs in the input text into HTML paragraphs by applying relevant tags.
We also have a MdTextProcessor named derived ...