Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OOC keynote: Object Oriented Diversity

nrs
February 16, 2020

OOC keynote: Object Oriented Diversity

Object Oriented Conference の基調講演です。

# URL
HomePage: https://nrslib.com
Twitter: https://twitter.com/nrslib

nrs

February 16, 2020
Tweet

More Decks by nrs

Other Decks in Technology

Transcript

  1. 3

  2. 4

  3. 5

  4. 6

  5. 7

  6. 12

  7. 25 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  8. 26 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  9. 27 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  10. 28 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  11. 29 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  12. 32 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  13. 33 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  14. 34 public class ProposalSubmitService { private readonly IProposalRepository proposalRepository; public

    ProposalSubmitService(IProposalRepository proposalRepository) { this.proposalRepository = proposalRepository; } public void Handle(ProposalSubmitCommand command) { ... var proposal = new Proposal(command.Title, command.Outline); proposalRepository.Save(proposal); ... } }
  15. 35 public void Main(string input) { var repository = CreateRepository(input);

    var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
  16. 36 public void Main(string input) { var repository = CreateRepository(input);

    var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
  17. 37 public void Main(string input) { var repository = CreateRepository(input);

    var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
  18. 38 public void Main(string input) { var repository = CreateRepository(input);

    var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
  19. 39 public void Main(string input) { var repository = CreateRepository(input);

    var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
  20. 43

  21. 60

  22. 61

  23. 62

  24. 64

  25. 65