Archive de "juillet, 2009"
11
juillet
2009
[Design pattern Factory] A mort le héro.
juillet
2009
Apprenons le Design pattern Factory par un exemple. Prenons un code développé sans Design pattern : class Program { static void Main(string[] args) { Program p = new Program(); p.RunShell(); } public void RunShell() { bool finished = false; while (!finished) { Console.Write(« > »); String line = Console.ReadLine(); String[] lineArgs = line.Split(new char[] { ‘ ‘, ‘\t’ }); switch (lineArgs[0]) { case « exit »: Console.WriteLine(« Bye bye »); finished = true; break; case « help »: Console.WriteLine(« Help : »); Console.WriteLine(« ——« ); Console.WriteLine(« copy: copy […]