forked from danieldantasdev/DesignPatternsInUse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
15 lines (13 loc) · 840 Bytes
/
Program.cs
File metadata and controls
15 lines (13 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* This example demonstrates how the CSV and JSON data processors read and
* process data specific to their formats by overriding the ReadData method.
* Each processor reads its respective data format, processes it (here, simple transformations
* are applied for demonstration purposes), and then the SaveData method saves the processed data.
* This approach showcases the flexibility of the Template Method pattern, allowing subclasses
* to not only provide specific behaviors for certain steps of an algorithm but also to
* extend or completely redefine those steps as needed. */
Console.WriteLine("CSV Processor:");
DataProcessor csvProcessor = new CsvDataProcessor();
csvProcessor.ProcessData();
Console.WriteLine("\nJSON Processor:");
DataProcessor jsonProcessor = new JsonDataProcessor();
jsonProcessor.ProcessData();