static void Main(string[] args) { var frontEnd = new FrontEndDeveloper(); var backEnd = new BackEndDeveloper(); var sa = new SolutionArchitect(); Console.WriteLine("----Front End Dev Routine----"); frontEnd.DailyRoutine(); Console.WriteLine("----Back End Dev Routine----"); backEnd.DailyRoutine(); Console.WriteLine("----Solution Architect Routine----"); sa.DailyRoutine(); }
static void Main(string[] args) { #region Encapsulation SoftwareEngineer softwareEngineer = new SoftwareEngineer("Jeff", "Bezos", 33, "Amazon", "C#"); softwareEngineer.BuildProject(); CarEngineer carEngineer = new CarEngineer("Ayrton", "Senna", 60, "McLaren"); carEngineer.BuildProject(); #endregion #region Inheritance FrontEndDeveloper frontEndDeveloper = new FrontEndDeveloper("Michael", "Jordan", "React.js"); frontEndDeveloper.Position(); frontEndDeveloper.Experience(); BackEndDeveloper backEndDeveloper = new BackEndDeveloper("Elon", "Musk", 7, "San Francisco", "US"); backEndDeveloper.Position(); backEndDeveloper.Experience(); backEndDeveloper.Team(); #endregion #region Polymorphism WebDeveloper webDeveloper = new WebDeveloper("C#"); webDeveloper.Code(); webDeveloper.Code("JavaScrit"); List <Developer> developers = new List <Developer>() { new WebDeveloper("JavaScript"), new AppDeveloper("React.js") }; foreach (var item in developers) { item.Code(); } #endregion }
// [I] Client should not be forced to depend on interfaces they don't use //It's better to make alot of small interfaces then general one. static void Main(string[] args) { IBackEnd backEndDev = new BackEndDeveloper(); backEndDev.FirstName = "John"; backEndDev.LastName = "Doe"; Console.WriteLine($"{backEndDev.FirstName} {backEndDev.LastName} - Back End Developer"); backEndDev.BackEndProgramming(); backEndDev.SoftwareTesting(); IFrontEnd frontEndDev = new FrontEndDeveloper(); frontEndDev.FirstName = "Suzan"; frontEndDev.LastName = "Anders"; Console.WriteLine($"\n{frontEndDev.FirstName} {frontEndDev.LastName} - Front End Developer"); frontEndDev.DesigningFrontEnd(); frontEndDev.FrontEndPrograming(); IFullStack fullStackDev = new FullStackDeveloper(frontEndDev, backEndDev); fullStackDev.FirstName = "Michael"; fullStackDev.LastName = "Sender"; Console.WriteLine($"\n{fullStackDev.FirstName} {fullStackDev.LastName} - Full Stack Developer"); fullStackDev.BackEndProgramming(); fullStackDev.DesigningFrontEnd(); fullStackDev.FrontEndPrograming(); fullStackDev.SoftwareTesting(); Console.ReadLine(); }