This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SadService | |
{ | |
public SadService() | |
{ | |
Console.WriteLine("SadService Created"); | |
} | |
public void Do() | |
{ | |
Console.WriteLine("Oh oh oh oh oh oh oh oh..."); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HappyService | |
{ | |
public HappyService() | |
{ | |
Console.WriteLine("HappyService create"); | |
} | |
public void Do() | |
{ | |
Console.WriteLine("Ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace design_pattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// 原本寫法註解方便比較 | |
// Toyote car1 = new Toyote(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum RacingType | |
{ | |
Default = 0, | |
Toyote = 1, | |
Bens = 2, | |
Tezla = 3, | |
Blanket = 4, | |
Chair = 5, | |
Gororo = 6, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRacing | |
{ | |
public void Skill(); | |
} | |
public class Toyote: IRacing | |
{ | |
private ISkill _skill; | |
public Toyote() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRacing | |
{ | |
public void Skill(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace design_pattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var people1 = new People("Alvin"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace design_pattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Toyote car1 = new Toyote(); | |
Bens car2 = new Bens(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace design_pattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Toyote car1 = new Toyote(); | |
Bens car2 = new Bens(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace design_pattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Toyote car1 = new Toyote(); | |
Bens car2 = new Bens(); |
NewerOlder