Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A_resource_oriented_framework_using_the_DI___AO...
Search
Akihito Koriyama
August 02, 2013
30
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A_resource_oriented_framework_using_the_DI___AOP___REST_Triangle.pdf
Akihito Koriyama
August 02, 2013
More Decks by Akihito Koriyama
See All by Akihito Koriyama
BEAR.Sunday — リソース指向 PHP アプリケーションフレームワーク
koriym
0
54
存在論的プログラミング: 時間と存在を記述する
koriym
5
1.2k
Be Framework: 生命システムとしての存在理解
koriym
0
190
新世界の理解
koriym
0
260
AI Centric
koriym
0
810
app-state-diagram
koriym
0
180
OOP, Double Dispatch and Visitor Pattern
koriym
3
220
BEAR.Sunday 2014-2024
koriym
0
110
イベント駆動コンテンツ (a.k.a Webアプリケーションの効率を再定義するBEAR.Sundayの分散キャッシングフレームワーク)
koriym
5
9.9k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Side Projects
sachag
456
43k
Google's AI Overviews - The New Search
badams
0
1.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Writing Fast Ruby
sferik
630
63k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The browser strikes back
jonoalderson
0
1.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
350
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
900
Transcript
A resource oriented framework using the DI / AOP /
REST Triangle Version 0.1 (27 July
[email protected]
meetup #2)
Authors • Akihito Koriyama • Richard McIntyre
What’s BEAR.Sunday ? (1) • DI / AOP / REST
centered framework DI AOP REST
DI • Dependency inversion principle (DIP) • Object instantiation /
usage separation
DIP • Code should depend on things that are at
the same or higher level of abstraction • High level policy should not depend on low level details
Object instantiation / usage separation • Don’t mix (compile /
runtime ) • One time object construction DPNQJMF SVOUJNF
Application object graph by context • Application is single big
one valuable • Change structure, not behavior $app Object i/f i/f Object i/f i/f Object Router Response JSON XM L
Application class
ʁ #FUUFS DPNQJMF SVOUJNF
Ray.Di • Annotation based DI framework • Binding DSL •
True DI
AOP • Cross cutting concern as framework function • Multi
layered architecture Cache Log Auth
Aspects • log / cache / validation ... are aspects.
• Core concern is your domain model, not aspects.
Binding by context • Annotate, then bind interpretation • @Api
is intention. “JSON” is implement.
ऍΛղऍ ͜͜ͰʮΫϥεʹ@Dbͱऍ͕͋Δʯˍ ʮ”on”Ͱ࢝·͍ͬͯΔʯϝιουʹDBΛ ηοτ͢ΔDBΠϯδΣΫλʔΛଋറ ͍ͯ͠ ·͢ɻ DBΠϯδΣΫλʔϝιουʹΑͬ ͯmaster/slaveΛબ͠DBΦϒδΣΫτΛ ೖ͠·͢ɻ ར༻ଆɺඃར༻ଆͱʹDBऔಘ
ͷؔ৺͕͞Ε͍ͯ·͢ɻ ଋറ
Binding by condition • @Log all DELETE method • @Auth
all /admin/ path resources
Layering by context • MVC, Is 3 enough ?
Layering by context • Configurable layering over fixed callback Model
Cache Form Transaction Auth Validation
Runtime injection by aspect • Parameter provider inject parameter. •
method / parameter lookup • test friendly
Ray.Aop • AOP alliance standard • Injectable interceptor • Google
Guice
REST • Everything is a resource / API • use
URI, not class name
API driven development • API is hub • test friendly
DB API Mobile Web API Cloud Mock URI API
Resource graph • Resource is layered
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
Layered Resource UI Mobile Web Page Resource App script App
Resource Entity
Lazy request • ϏϡʔτϦΨʔͷϦιʔεϦΫΤετ
What’s BEAR.Sunday ? (2) • Resource oriented framework • no
control-object paradigm • information has name
What’s BEAR.Sunday ? (3) • Connecting framework • DI -
object to object • AOP -business logic to app logic • REST - information to information
Performance • Super fast • cache compiled object • cache
all objects • http friendly architecture
Hard functionality / Soft functionality • DI for application function
• AOP for runtime function
Scale • “model proxy” pattern • runtime injection makes db
scale easy
What’s BEAR.Sunday ?
“Zen” Framework less is more.
Arigato Photo socket http://www.flickr.com/photos/sydeen/5199310841/ three cat http://www.flickr.com/photos/ferran-jorda/2188887967 mvc http://symfony.com/legacy/doc/jobeet/1_2/en/04?orm=Propel