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

コードをどまんなかに据えた設計アプローチ

irof
December 15, 2018

 コードをどまんなかに据えた設計アプローチ

JJUG CCC 2018 Fall
2018-12-15T16:45+09:00
#ccc_e6
http://www.java-users.jp/ccc2018fall

irof

December 15, 2018
Tweet

More Decks by irof

Other Decks in Technology

Transcript

  1. class ShipIdentifier { String value; public ShipIdentifier() { value =

    UUID.randomUUID().toString(); } ... } ધ͸*%Ͱࣝผ͞ΕΔɻ ൪߸ମܥ͸66*%ɻ ੜ੒Օॴ͸ίϯετϥΫλͷࢀরɻ ࢖༻Օॴ͸Ϋϥεࢀরɻ
  2. String sheetTypeCode = "1"; sheet_type_code | name ================|======= 1 |

    ࣗ༝੮ 2 | ࢦఆ੮ 3 | άϦʔϯ੮ Α͘ݟΔίʔυͱ%#ͷ૊Έ߹Θͤ
  3. ShopIdentifier shopId = ... SchoolIdentifier schoolId = new SchoolIdentifier( shopId.toString());

    γϣοϓͱεΫʔϧΛѻ͏ۀ຿ɻ γϣοϓʹεΫʔϧΛซઃ͢Δ৔߹ ͸ಉ͡*%Λ࢖͏Α͏͕ͩɺຒ΋Ε ͯ͠·͏ɻ
  4. class Name { ... } School school = new School(name);

    User employee = new User(name); ܕΛ࡞Δҙຯ͕ͳ͍ɻ ֶߍ໊ͱϢʔβʔ໊͕ಉ͡ͱ ͍͏ۀ຿ͳΒਖ਼͍͕͠ʜʜ
  5. ίʔυ͕Ͳ·Μͳ͔ʹ͋Ε͹ ޾ͤʹͳΔΑ wίʔσΟϯά͸ͨ͘͞ΜঝೝཉٻΛຬ ͨͯ͘͠ΕΔɻ w ίϯύΠϧ௨ͬͨɻ w ςετ௨ͬͨɻ w ಈ͍ͨɻ

    w ͔ͯλΠϓͯ͠Δ͚ͩͰ΋ɻολʔϯɻ wίʔυॻ͘ͷָ͍͔͠ΒɺίʔυΛॻ ͘͜ͱΛਖ਼౰ԽɻͦΜͳΞϓϩʔνɻ