64
imageStorage.Store("banner.jpg", new JpgCompressor(), new BlackAndWhiteFilter());
1
using System;
2
3
public interface ICompressor
4
{
5
void Compress(string fileName);
6
}
7
8
public class JpgCompressor: ICompressor
9
{
10
public void Compress(string fileName)
11
{
12
Console.WriteLine("Compressing using JPG");
13
}
14
}
15
16
public class PngCompressor: ICompressor
17
{
18
public void Compress(string fileName)
19
{
20
Console.WriteLine("Compressing using JPG");
21
}
22
}
23
24
public interface IFilter
Cached Result
Add 2 numbers using linked list
result=2
result=5
in
7 + 0
0
in
0 + 1
7
in
8 + 0
0
result=7
7
0
8
result=2
result=5
in
7 + 0
0
in
0 + 1
7
in
8 + 0
0
result=7
7
0
8