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

Ray.Di-Ray.AopからみるPHP5.4+フレームワークBEAR.Sunday

 Ray.Di-Ray.AopからみるPHP5.4+フレームワークBEAR.Sunday

madapaja

July 30, 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. DIP? • Dependency Inversion Principle / ґଘؔ܎ٯసͷݪଇ • ࣮૷ʹґଘͤͣɺந৅ʹґଘ͢Δ •

    ϓϩάϥϜ͸۩ମతͳΫϥεʹґଘͯ͠͸͍͚ͳ͍ • ந৅ͱ࣮૷ͷৄࡉ͕׬શʹ੾Γ཭͞ΕΔʢϝϯςָ͕ ʹʣ
  5. RAY.DI • based on Aura.Di • ΫϦʔϯ —— ίϯςφࣗ਎ͷґଘੑ΋શͯ֎෦஫ೖʹ಺෦Ͱ new

    ͞Ε͍ͯΔݻఆΫϥε͕ͳ ͘ೖΕସ͑Մೳ • ίϯετϥΫλ/ηολʔΠϯδΣΫγϣϯ • ܧঝ͕༗ޮͳωʔϜυύϥϝʔλࢦఆ • JSR-250(Common Annotations for Java)/330(DI for Java)ελΠϧΞϊςʔγϣϯͷҰ෦Λ ࣮૷ • Doctrine\Common\Annotations ʹΑΔΞϊςʔγϣϯ࣮૷ • Ray.AopʹΑΔΞεϖΫτΛ৫ΓࠐΜͩΦϒδΣΫτͷऔಘ
  6. OBJECT FRAMEWORK? • Ray.Di • ΦϒδΣΫτੜ੒ͷͨΊͷϑϨʔϜϫʔΫ • Ϟδϡʔϧ͕͍࣋ͬͯΔ஌ࣝΛར༻ͯ͠ɺDiͱΞεϖΫτΛߏ੒͠ɺΦϒδΣΫτάϥϑΛߏஙʢʹ ίϯύΠϧʣ •

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

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

    ͋ͨΓ͔Β࢝ΊΔͷ͕Φεεϝ • Ray.Aop Λ΍ͬͯΈΔ৔߹͸Ray.DiΛ௨ͯ͠৮Δͷָ͕ • Ray ʹؔͯ͠͸ɺϒϩάʢhttp://blog.madapaja.net/ʣʹ΋ ॻ͍ͨͷͰɺࢀߟʹͳΔ͔΋ʁ • Have fun!
  9. ࢀߟ • 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/