Slide 1

Slide 1 text

A resource oriented framework using the DI / AOP / REST Triangle Version 0.1 (27 July [email protected] meetup #2)

Slide 2

Slide 2 text

Authors • Akihito Koriyama • Richard McIntyre

Slide 3

Slide 3 text

What’s BEAR.Sunday ? (1) • DI / AOP / REST centered framework DI AOP REST

Slide 4

Slide 4 text

DI • Dependency inversion principle (DIP) • Object instantiation / usage separation

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Object instantiation / usage separation • Don’t mix (compile / runtime ) • One time object construction DPNQJMF SVOUJNF

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

Application class

Slide 9

Slide 9 text

ʁ #FUUFS DPNQJMF SVOUJNF

Slide 10

Slide 10 text

Ray.Di • Annotation based DI framework • Binding DSL • True DI

Slide 11

Slide 11 text

AOP • Cross cutting concern as framework function • Multi layered architecture Cache Log Auth

Slide 12

Slide 12 text

Aspects • log / cache / validation ... are aspects. • Core concern is your domain model, not aspects.

Slide 13

Slide 13 text

Binding by context • Annotate, then bind interpretation • @Api is intention. “JSON” is implement.

Slide 14

Slide 14 text

஫ऍΛղऍ ͜͜Ͱ͸ʮΫϥεʹ@Dbͱ஫ऍ͕͋Δʯˍ ʮ”on”Ͱ࢝·͍ͬͯΔʯϝιουʹ͸DBΛ ηοτ͢ΔDBΠϯδΣΫλʔΛଋറ ͍ͯ͠ ·͢ɻ DBΠϯδΣΫλʔ͸ϝιουʹΑͬ ͯmaster/slaveΛબ୒͠DBΦϒδΣΫτΛ஫ ೖ͠·͢ɻ ར༻ଆɺඃར༻ଆͱ΋ʹDBऔಘ ͷؔ৺͕෼཭͞Ε͍ͯ·͢ɻ ଋറ

Slide 15

Slide 15 text

Binding by condition • @Log all DELETE method • @Auth all /admin/ path resources

Slide 16

Slide 16 text

Layering by context • MVC, Is 3 enough ?

Slide 17

Slide 17 text

Layering by context • Configurable layering over fixed callback Model Cache Form Transaction Auth Validation

Slide 18

Slide 18 text

Runtime injection by aspect • Parameter provider inject parameter. • method / parameter lookup • test friendly

Slide 19

Slide 19 text

Ray.Aop • AOP alliance standard • Injectable interceptor • Google Guice

Slide 20

Slide 20 text

REST • Everything is a resource / API • use URI, not class name

Slide 21

Slide 21 text

API driven development • API is hub • test friendly DB API Mobile Web API Cloud Mock URI API

Slide 22

Slide 22 text

Resource graph • Resource is layered

Slide 23

Slide 23 text

http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

Slide 24

Slide 24 text

Layered Resource UI Mobile Web Page Resource App script App Resource Entity

Slide 25

Slide 25 text

Lazy request • ϏϡʔτϦΨʔͷϦιʔεϦΫΤετ

Slide 26

Slide 26 text

What’s BEAR.Sunday ? (2) • Resource oriented framework • no control-object paradigm • information has name

Slide 27

Slide 27 text

What’s BEAR.Sunday ? (3) • Connecting framework • DI - object to object • AOP -business logic to app logic • REST - information to information

Slide 28

Slide 28 text

Performance • Super fast • cache compiled object • cache all objects • http friendly architecture

Slide 29

Slide 29 text

Hard functionality / Soft functionality • DI for application function • AOP for runtime function

Slide 30

Slide 30 text

Scale • “model proxy” pattern • runtime injection makes db scale easy

Slide 31

Slide 31 text

What’s BEAR.Sunday ?

Slide 32

Slide 32 text

“Zen” Framework less is more.

Slide 33

Slide 33 text

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