Ejemplo n.º 1
0
    Person GetPerson()
    {
        Pilot p;

        p = (Pilot)PersonFactory.CreatePerson("Pilot");     // this code already knows to expect a Pilot, so why not just call CreatePilot or CreatePerson<Pilot>()?
        p = PersonFactory.CreatePilot();
        p = PersonFactory.CreatePerson <Pilot>();
        return(p);
    }