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

Ray.Di / Ray.Aop コトハジメ

madapaja
July 19, 2012

Ray.Di / Ray.Aop コトハジメ

madapaja

July 19, 2012
Tweet

More Decks by madapaja

Other Decks in Technology

Transcript

  1. BEAR.SUNDAY KEYWORDS • PHP (5.4+) • Ϧιʔεࢦ޲ϑϨʔϜϫʔΫ / Because Everything

    is A Resource • ؔ৺ͷ෼཭ • REST • ίϚϯυΫΤϦ੹຿෼཭(CQRS) • APIۦಈ։ൃ • ΞεϖΫτࢦ޲ϓϩάϥϛϯά(AOP) • ґଘੑͷ஫ೖ(DI) • Cache • HATEOAS(Hypermedia as the Engine of Application State) • ...
  2. BEAR.SUNDAY 2ͭͷப • Ray • DI / AOP support •

    BEAR.Resource • Ϧιʔεࢦ޲ΞʔΩςΫνϟʢROAʣʹΑΔίϯ ϙʔωϯτ઀ଓͷͨΊͷαʔϏεϨΠϠϑϨʔϜϫʔ Ϋ
  3. RAY • Google Guice ͔ΒΠϯεύΠΞ • 2ͭͷύοέʔδ • Ray.Di •

    Ξϊςʔγϣϯϕʔεͷ Dependency Injection ϑϨʔϜϫʔΫ • ґଘੑͷ஫ೖΛ൐͏ΦϒδΣΫτͷੜ੒ͱ؅ཧ • Ray.Aop • ΞεϖΫτࢦ޲ϑϨʔϜϫʔΫ
  4. RAY.DI • based on Aura.Di • ΫϦʔϯ —— ίϯςφࣗ਎ͷґଘੑ΋શͯ֎෦஫ೖʹ಺෦Ͱ new

    ͞Ε͍ͯΔݻఆΫϥε͕ͳ ͘ೖΕସ͑Մೳ • ίϯετϥΫλ/ηολʔΠϯδΣΫγϣϯ • ܧঝ͕༗ޮͳωʔϜυύϥϝʔλࢦఆ • JSR-250(Common Annotations for Java)/330(DI for Java)ελΠϧΞϊςʔγϣϯͷҰ෦Λ ࣮૷ • Doctrine\Common\Annotations ʹΑΔΞϊςʔγϣϯ࣮૷ • Ray.AopʹΑΔΞεϖΫτΛ৫ΓࠐΜͩΦϒδΣΫτͷऔಘ
  5. MODULE? • ಛఆͷؔ৺ྖҬʹ͍ͭͯͷઃఆ΍ߏ੒Λߦ͏୯Ґ ʢओʹDI΍ΠϯλʔηϓλͷͨΊͷόΠϯυΛߦ͏ʣ • ػೳͷؔ৺ʢDoctrineOrmModule/SwiftMailerModule...ʣ΍ ಈ࡞ϞʔυʢProdModule/DevModule...ʣͳͲͰ෼ׂ • Ϟδϡʔϧ͸ɺଞͷϞδϡʔϧΛ install

    Ͱؔ৺͝ͱʹ෼͚ΒΕͨϞδϡʔϧΛ߹੒Ͱ͖·͢ • ࠷ऴతʹ߹੒͞Εͨ஌ࣝʹΑͬͯΦϒδΣΫτάϥϑ͕ߏங͞Ε·͢ɻ • ϞδϡʔϧʹΑΓɺαʔϏείϯϙʔωϯτͦͷ΋ͷΛDIʹΑͬͯೖΕସ͑ɺ ͦͷৼΔ෣͍ΛAOPͰมߋ͢Δ ʢଟ͘ͷϑϨʔϜϫʔΫͱ͸ҟͳΓɺFWͰൃߦ͞ΕΔΠϕϯτ΍γάφϧʹରͯ͠ɺ ɹAppଆͰίʔϧόοΫΛΞλον͢ΔͷͰ͸͋Γ·ͤΜʣ
  6. RAY.DI OTHERS • @PostConstruct Ξϊςʔγϣϯ • શͯͷґଘ͕஫ೖࡁΈͷ͜ͱ͕อূ͞Εͨঢ়ଶͰͷॳظԽॲཧ • @PreDestory Ξϊςʔγϣϯ

    • શͯͷґଘΦϒδΣΫτ͕ഁյ͞Εͯͳ͍͜ͱ͕อো͞Εͨঢ়ଶͰͷγϟοτμ΢ϯॲཧ • @Scope • ΠϯελϯεͷৼΔ෣͍ઃఆʢγϯάϧτϯʣ • ηολʔΠϯδΣΫγϣϯ • traitΠϯδΣΫγϣϯ • ϓϩόΠμʔ • ...
  7. OBJECT FRAMEWORK? • Ray.Di • ΦϒδΣΫτੜ੒ͷͨΊͷϑϨʔϜϫʔΫ • Ϟδϡʔϧ͕͍࣋ͬͯΔ஌ࣝΛར༻ͯ͠ɺDiͱΞεϖΫτΛߏ੒͠ɺΦϒδΣΫτάϥϑΛߏஙʢʹ ίϯύΠϧʣ •

    ૣظଋറͷߏ੒ʢܾ·ͬͯΔ΋ͷɺมߋ͕ͳ͍΋ͷʣ • Ray.Aop • ΦϒδΣΫτར༻ͷͨΊͷϑϨʔϜϫʔΫ • ϥϯλΠϜ • ஗Ԇଋറͷߏ੒ʢ࣮ߦ࣌ʹܾఆ͢ΔDBͷ઀ଓઌͳͲʣ͸ܾఆͨ࣌͠ʹόΠϯυ ʢϥϯλΠϜΠϯδΣΫλʣ
  8. OBJECT FRAMEWORK? • ੜ੒ͱར༻ͷ෼཭ • RayʢBEARʣͰ͸ੜ੒ͱར༻͕෼཭͞Ε͍ͯΔ • ੜ੒ͱར༻Λಉ࣌ʹߦΘͳ͍ • ੜ੒ͷ࠶ར༻͕Մೳ

    • ଞͷϑϨʔϜϫʔΫͱҰઢΛը͢ϨϕϧͰΩϟογϡΛߦ͑Δ • PHPɺΞϊςʔγϣϯͷύʔεɺΠϯδΣΫγϣϯͷίετ͕ݪཧతʹ0ʹͳΔ • Ray = ΦϒδΣΫτͷʮੜ੒ɺར༻ɺফ໓ʯΛ໘౗ΈΔΦϒδΣΫτϑϨʔϜϫʔΫ
  9. ·ͱΊ • BEAR.Sunday Λ৮ͬͯΈΑ͏ • Ray.Di / Ray.Aop / BEAR.Resource

    ͋ͨΓ͔Β࢝ΊΔͷ͕Φεεϝ • Ray.Aop Λ΍ͬͯΈΔ৔߹͸Ray.DiΛ௨ͯ͠৮Δͷָ͕ • Ray ʹؔͯ͠͸ɺϒϩάʢhttp://blog.madapaja.net/ʣʹ΋ ॻ͍ͨͷͰɺࢀߟʹͳΔ͔΋ʁ • Have fun!
  10. ࢀߟ • BEAR.Sunday Manual: http://code.google.com/p/bearsunday/wiki/manual?tm=6 • Ray PHP User Guide:

    http://code.google.com/p/rayphp/wiki/Motivation?tm=6 • BEAR.Sunday github: https://github.com/koriym/BEAR.Sunday • BEAR Blog: http://www.bear-project.net/blog/ • ܊ࢁ͞Μ Slideshare: http://www.slideshare.net/akihito.koriyama/