public OrdenacionBuilder GetOrdenacionBuilder(string _string) { OrdenacionBuilder builder = null; if (_string.Equals("QS")) { builder = new OrdenacionQuickSort(); } return(builder); }
public void TestVersion02() { string[] datos = new string[] { "d", "g", "a", "b", "c", "h", "k" }; OrdenacionFactory factory = new OrdenacionFactory(); OrdenacionBuilder builder = factory.GetOrdenacionBuilder("QS"); OrdenacionDirector director = new OrdenacionDirector(builder); director.Build(datos); for (int i = 0; i < datos.Length; i++) { Debug.WriteLine(datos[i]); } }