Successfully reported this slideshow.
Your SlideShare is downloading. ×

Beautiful Development ブレイクスルー体験記

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 53 Ad
Advertisement

More Related Content

Slideshows for you (20)

Recently uploaded (20)

Advertisement

Beautiful Development ブレイクスルー体験記

  1. 1. PARTⅢ http://www.flickr.com/photos/penguinbush/2768719983/
  2. 2. (kentaro714) JavaEE Clojure IT
  3. 3. Agenda • PartⅢ • • • DDD
  4. 4. PartⅢ
  5. 5. Part1 PartⅡ ParⅢ
  6. 6. 1000
  7. 7. 20% … 1000 30% 50%
  8. 8. 500×0.2=100 500 000 500 500 500×0.3=150 500×0.5=250
  9. 9. 800 300 300 500 200
  10. 10. *+ $%&'() *+# !"# ,-.(/#) 01.(/#) 2+ *+78 2+34 /*+# 2+56
  11. 11. 200 :%&'()* :+, !"# = 1000$ +,# = 200$ 12A0,:0, -+,./ 0,12 = A12 0,34 = 20% +,# = 40$ 12B0,:0, -+,./ 0,12 = B12 0,34 = 30% +,# = 60$ 12C0,:0, -+,./ 0,12 = C12 0,34 = 50% +,# = 100$
  12. 12. … 500 500×0.2-50=50 50 200 700 500×0.3 500×0.5+50 =150 =300
  13. 13. ,-./01 23 !"# 23# $%&'($%(, $%), *+) 45&(6#) 78&(6#) 93 23<= 93:; /23# 93*+ 23$% 23#
  14. 14. :%&'()* :+, !"# = 1000$ +,# = 700$ 12A0,:0, -+,./ 0,12 = A12 0,34 = 20% +,# = 90$ 12B0,:0, -+,56 0,12 = B12 0,34 = 30% +,# = 150$ 12C0,:0, -+,./ 0,12 = C12 0,34 = 50% +,# = 400$
  15. 15. Application Service public class SyndicateService { private FacilityRepository facilityRepository; private LoanRepository loanRepository; public void drawDownWithAdjustment(long facilityId, BigDecimal amount, Map<String, BigDecimal> adjustment) { Facility facility = facilityRepository.get(facilityId); Loan loan = facility.getLoan(); for (Investment investment : facility.getInvestments()) { if (adjustment.containsKey(investment.getInvestor().getName())) { BigDecimal share = BigDecimal.valueOf(investment.getPercentage()); BigDecimal variance = adjustment.get(investment.getInvestor() .getName()); LoanAdjustment loanAdjustment = new LoanAdjustment( Money.yen(amount.multiply(share).add(variance))); loan.addLoanInvestment(loanAdjustment); } } loanRepository.save(loan); }
  16. 16.
  17. 17. 500×90/700=64.28.. 500 500 300 800 500×210/700 500×400/700 =150 =285.714...
  18. 18.
  19. 19. Application Service public class SyndicateService { private FacilityRepository facilityRepository; private LoanRepository loanRepository; public void processPrincipalPayment(long facilityId, BigDecimal amount) { Facility facility = facilityRepository.get(facilityId); Loan loan = facility.getLoan(); for (LoanInvestment investment : loan.getLoanInvestments()) { BigDecimal share = investment.getAmount().divide(loan.getAmount()); Money newAmount = Money.yen(amount.multiply(share)); LoanAdjustment loanAdjustment = new LoanAdjustment(investment .getAmount().minus(newAmount)); loan.addLoanInvestment(loanAdjustment); } loanRepository.save(loan); }
  20. 20. 2 …
  21. 21.
  22. 22. ,-./01 23 !"# 23# $%&'($%(, $%), *+) 45&(6#) 78&(6#) 93 23<= 93:; /23# 93*+ 23$% 23#
  23. 23. :1000 100 20% ¥20 50% 100 ¥30 ¥50 30%
  24. 24. ¥70 ¥50 ¥20 ¥50 ¥150 ¥180 ¥30 ¥300 ¥350 100 500 600
  25. 25. +,-./ +,- * !"#$(%&) 0121 '(#$('(), '(*, %&) +,-3 7+,-./ 45+,-./ 6#(7+,-./) 89:7+,-./;
  26. 26. 78 ,-./01 78+ )*+ !"#$(!"%, !"&, '() 23#(4+) 56#(4+) '(.9:;< =.9:;< * * .9: .9: >?@? >?@? .9:A .9:A
  27. 27. Application Service public class SyndicateService { private FacilityRepository facilityRepository; private LoanRepository loanRepository; public void drawDownWithAdjustment(long facilityId, BigDecimal amount, Map<String, BigDecimal> adjustment) { Facility facility = facilityRepository.get(facilityId); Loan loan = facility.getLoan(); AmountPie drawDownSharePie = facility.getPie().prorate(amount); AmountPie adjustSharePie = AmountPie.createFrom(adjustment); loan.setPie(drawDownSharePie.plus(adjustSharePie)); loanRepository.save(loan); } public void processPrincipalPayment(long facilityId, BigDecimal amount) { Facility facility = facilityRepository.get(facilityId); Loan loan = facility.getLoan(); SharePie principalSharePie = loan.getPie().prorate(amount); loan.setPie(loan.getPie().minus(principalSharePie)); loanRepository.save(loan); }
  28. 28.
  29. 29. #&'() !"#$% 12 3#&'() *+#,-. /0 *+#,-. :;<=> BCDE 40 *+#,-. 2789 ?@A<=> 5612 AP
  30. 30. Application Service public void drawDownWithAdjustment(long facilityId, BigDecimal amount, Map<String, BigDecimal> adjustment) { Facility facility = facilityRepository.findById(facilityId); Loan loan = facility.getLoan(); SharePie drawDownSharePie = facility.getSharePie().prorate(amount); SharePie adjustSharePie = AmountPie.createFrom(adjustment); Transaction drawDown = new DrawDown(loan, drawDownSharePie.plus(adjustSharePie)); loan.apply(drawDown); loanRepository.save(loan); } public void processPrincipalPayment(long facilityId, BigDecimal amount) { Facility facility = facilityRepository.get(facilityId); Loan loan = facility.getLoan(); SharePie principalSharePie = loan.getPie().prorate(amount); Transaction principalPayment = new PrincipalPayment(loan, principalSharePie); loan.apply(principalPayment); loanRepository.save(loan); }
  31. 31. public class DrawDown extends Transaction { public DrawDown(Position position, SharePie sharePie) { super(position, sharePie); } @Override public void execute() { SharePie newSharePie = position.getPie().plus(this.sharePie); position.setPie(newSharePie); } }
  32. 32.
  33. 33. #&'() !"#$% * 12 3#&'() *+#,-. /0 *+#,-. :;<=> BCDE 40
  34. 34. http://www.flickr.com/photos/94379417@N00/4808475862/in/photostream/
  35. 35. http://www.flickr.com/photos/dmclear/5418495331/
  36. 36. http://www.flickr.com/photos/spcbrass/5451894896/
  37. 37. DDD

Editor's Notes

  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

×