oo-70-245-1

oo-70-245-1 Commit Details


Date:2014-10-27 18:31:21 (9 years 11 months ago)
Author:Natalie Adams
Branch:master
Commit:0f35c67dfb5bed9eb92dd7630585ef0708da88eb
Parents: 1dc40cb1ad5a50e77a0ba65aaa282ee5e0841a4c
Message:adding proxy example

Changes:

File differences

Design Pattern Examples/Proxy/Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace proxyexample
{
public interface IClient
{
string GetData();
}
public class RealClient : IClient
{
string Data;
public RealClient()
{
Console.WriteLine("Real Client: initilizalized");
Data = "realclient test";
}
public string GetData()
{
return Data;
}
}
public class ProxyClient : IClient
{
RealClient client = new RealClient();
public ProxyClient()
{
Console.WriteLine("ProxyClient: Intilizied");
}
public string GetData()
{
return "X-Header1: test\n" + client.GetData();
}
}
class Program
{
static void Main(string[] args)
{
ProxyClient proxy = new ProxyClient();
Console.WriteLine("Data from proxy client = {0}", proxy.GetData());
}
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06517s using 14 queries.