SlideShare a Scribd company logo
ZFDAY - 2014

BUILD A CUSTOM (MICRO)FRAMEWORK
WITH ZF2 COMPONENTS AS BUILDING BLOCKS
Author Walter Dal Mut / @walterdalmut
WHO AM I?
Walter Dal Mut, I work at Corley S.r.l.
and also at UpCloo Ltd.
You can contact me at: walter.dalmut@gmail.com
On Twitter: @walterdalmut
On GitHub: wdalmut
WHY A CUSTOM FRAMEWORK?
Tipically because we want to solve a particular problem.
ZendFramework is a general purpose Web Framework that
can fit different problems easily.
IT SOUNDS LIKE REINVENTING THE WHEEL
NO, WE DON'T WANT!

We will use ZF2 components as building blocks
We will drive a personal behaviour
IT COULD WORK!!
REQUIREMENTS
Event Driven Design
Dependency Inversion Principle

TESTABLE/TDD
EVENT DRIVEN DESIGN
All framework operations are events (like ZF2)
DEPENDENCY INVERSION
We will focus on Service Manager
[ WE WANT TO TEST OUR APPLICATIONS ]
COMPOSE IT!
{

}

"eur" {
rqie:
"edrmwr/edeetaae" "."
znfaeokzn-vnmngr: 2*,
"edrmwr/edsrieaae" "."
znfaeokzn-evcmngr: 2*,
"edrmwr/edmc:"."
znfaeokzn-v" 2*,
"edrmwr/edht" "."
znfaeokzn-tp: 2*
}
,
"eur-e" {
rqiedv:
"hui/hui" ".."
ppntppnt: 37*
}
,
LET'S GO TO SCHOOL
We have to learn our building blocks!
THE EVENT MANAGER
$vnMngr=nwZnvnMngrEetaae(;
eetaae
e edEetaaevnMngr)
/ Tigra eet
/ rge n vn
pbi fnto tigr$vn,$agt=nl,$rv=nl)
ulc ucin rge(eet tre
ul ag
ul;
/ Atc alsee t a eet
/ tah
itnr o n vn
pbi fnto atc(eet $alak $roiy;
ulc ucin tah$vn, clbc, pirt)

There are many other methods (detach, triggerUntil, etc...)
See it on Github
HOW EVENT MANAGER WORKS?
pbi fnto tsEetaae(
ulc ucin etvnMngr)
{
$v =nwEetaae(;
e
e vnMngr)
$sald=fle
iCle
as;
$v>tah'neet,fnto(eet ue($sald {
e-atc(a-vn' ucin$vn) s &iCle)
$sald=tu;
iCle
re
};
)
$v>rge(a-vn";
e-tigr"neet)
}

$hs>setre$sald;
ti-asrTu(iCle)
THE SERVICE LOCATOR
$evcMngr=nwZnevcMngrSrieaae(;
srieaae
e edSrieaaeevcMngr)

"evcs = [
srie" >
"noals = [
ivkbe" >
"oraeop = "oraeop,
YuNmCm" > YuNmCm"
]
,
"atre"= [
fcois >
"oraeevc"= "oraeevcFcoy,
YuNmSrie > YuNmSrieatr"
]
,
"lae"= [
aiss >
"orais = "oraeevc"
yu.la" > YuNmSrie,
]
]

See it on Github
CONFIGURE S.L. FROM ARRAY
$evcMngr=nwZnevcMngrSrieaae(;
srieaae
e edSrieaaeevcMngr)
$ofg=nwZnevcMngrCni(
cni
e edSrieaaeofg[
"noals = [.]
ivkbe" > ..,
"atre"= [.]
fcois > ..,
"btatfcois = [.]
asrc_atre" > ..,
"lae"= [.]
aiss > ..
]
)
$ofg>ofgrSrieaae(srieaae)
cni-cniueevcMngr$evcMngr;
HOW SERVICE MANAGER WORKS?
pbi fnto tsSrieaae(
ulc ucin etevcMngr)
{
$m=nwSrieaae(;
s
e evcMngr)
$hs>ofg>ofgrSrieaae(s)
ti-cni-cniueevcMngr$m;
$hs>setre$m>a(eape);
ti-asrTu(s-hs"xml")

}

$hs>setae
ti-asrSm(
$m>e(eape)
s-gt"xml",
$m>e(eape)
s-gt"xml"
)
;
THE ROUTER
$t =ZnvotrHtreotSak:atr(ra $ofg;
rr
edMcRuetpTeRuetc:fcoyary cni)
"ots = [
rue" >
"otNm"= [
rueae >
"ye = "iea"
tp" > Ltrl,
"pin"= [
otos >
"ot"= "pt"
rue > /ah,
"eals = [
dfut" >
"otolr = "Fae,
cnrle" > ZNm"
"cin =>"cinae,
ato"
atoNm"
]
]
,
"a_emnt"= tu,
mytriae > re
]
]
$otMth=$t-mthRqet$eus)
rueac
rr>ac(eus rqet;
HOW ROUTER WORKS?
pbi fnto tsRueac(
ulc ucin etotMth)
{
$otr=TeRuetc:fcoy$hs>ofg;
rue
reotSak:atr(ti-cni)
$eus =nwRqet"pt";
rqet
e eus(/ah)
$otMth=$otr>ac(rqet;
rueac
rue-mth$eus)
$otolrae=$otrac-gtaa(cnrle";
cnrleNm
rueMth>ePrm"otolr)
$cinae=$otMth>ePrm"cin)
atoNm
rueac-gtaa(ato";

}

$hs>setqas"Fae,$otolrae)
ti-asrEul(ZNm" cnrleNm)
$hs>setqas"cinae,$cinae)
ti-asrEul(atoNm" atoNm)
REQUEST
/
/
$eus =nwedHthEvrnetRqet)
rqet
e ZntpPpniomneus(;
RESPONSE
$epne=nwedHthEvrnetRsos(;
rsos
e ZntpPpniomnepne)
$epne>dHaes[.];
rsos-adedr(..)
$epne>eCnet".";
rsos-stotn(..)
$epne>ed)
rsos-sn(;
HYDRATORS
pbi fnto etat$bet;
ulc ucin xrc(ojc)
pbi fnto hdaeary$aa $bet;
ulc ucin yrt(ra dt, ojc)
$lsMtos=nwedSdiyrtrCasehd(;
casehd
e ZntlbHdaolsMtos)
$betrp=nwedSdiyrtobetrpry)
ojcPo
e ZntlbHdarrOjcPoet(;
$ra =nwedSdiyrtoraSraial(;
ary
e ZntlbHdarrAryeilzbe)
LET'S START!
EVENTS!
THE FRAMEWORK EVENTS LIST
BEGIN

The loop begins

ROUTE

Parse the actual route in order to found a dispatchable action

PRE.FETCH

Before dispatch the action

EXECUTE

Dispatch all actions

RENDER

Render your data

FINISH

The loop ends
ON ERRORS?
BEGIN
ROUTE
PRE.FETCH
404/500/HALT
RENDER
FINISH
TEST IT!
pbi fnto tsBsAplw)
ulc ucin etaepFo(
{
$eus =Rqetatr:cetRqet"vldul,"E" [)
rqet
eusFcoy:raeeus(/ai-r" GT, ];
$p =nwAp)
ap
e p(;
$p-steus(rqet;
ap>eRqet$eus)
$p-stevcMngrnwZnevcMngrSrieaae()
ap>eSrieaae(e edSrieaaeevcMngr);
$p-stvnMngrnwZnvnMngrEetaae()
ap>eEetaae(e edEetaaevnMngr);
$epne=$p-rn)>epne)
rsos
ap>u(-rsos(;
}

$hs>setqas44 $epne>eSauCd()
ti-asrEul(0, rsos-gtttsoe);

F
FI ( tss 1asrin)
AL 1 et,
setos
REQUEST
pbi fnto steus(eus $eus)
ulc ucin eRqetRqet rqet
{
$hs>eus =$eus;
ti-rqet
rqet
}
pbi fnto rqet)
ulc ucin eus(
{
i ($hs>eus){
f !ti-rqet
$hs>eus =nwRqet)
ti-rqet
e eus(;
}
}

rtr $hs>eus;
eun ti-rqet
RESPONSE
pbi fnto stepneRsos $epne
ulc ucin eRsos(epne rsos)
{
$hs>epne=$epne
ti-rsos
rsos;
}
pbi fnto rsos(
ulc ucin epne)
{
i ($hs>epne {
f !ti-rsos)
$hs>epne=nwRsos(;
ti-rsos
e epne)
}
}

rtr $hs>epne
eun ti-rsos;
EVENT MANAGER
pbi fnto stvnMngr$vnMngr
ulc ucin eEetaae(eetaae)
{
$hs>vnMngr=$vnMngr
ti-eetaae
eetaae;
}
pbi fnto eet(
ulc ucin vns)
{
rtr $hs>vnMngr
eun ti-eetaae;
}
EVENT TRIGGER HELPER
pbi fnto tigr$ae ary$aas=[)
ulc ucin rge(nm, ra prm
]
{
$vn =nwEet)
eet
e vn(;
$vn-stagt$hs;
eet>eTre(ti)
$vn-staas$aas;
eet>ePrm(prm)
}

rtr $hs>vns)>rge(nm,$vn)
eun ti-eet(-tigr$ae eet;
SERVICE MANAGER
pbi fnto stevcMngr$evcMngr
ulc ucin eSrieaae(srieaae)
{
$hs>evcMngr=$evcMngr
ti-srieaae
srieaae;
}
pbi fnto srie(
ulc ucin evcs)
{
rtr $hs>evcMngr
eun ti-srieaae;
}
ENTRY POINT!
pbi fnto rn)
ulc ucin u(
{
$hs>rge(bgn)
ti-tigr"ei";
$vnsit=$hs>ipthsrcineaeEet(;
eetLs
ti-dsacUeAtoRltdvns)
$hs>rge(rne" [dt"= $vnsit)
ti-tigr"edr, "aa > eetLs];
$hs>rge(fns";
ti-tigr"iih)
}

rtr $hs
eun ti;
HEY, CAN YOU DO IT?
poetdfnto dsacUeAtoRltdvns)
rtce ucin ipthsrcineaeEet(
{
ty{
r
$vnsit=$hs>ipthsreus(;
eetLs
ti-dsacUeRqet)
}cth(atxeto $){
ac HlEcpin e
$vnsit=$hs>rge(hl";
eetLs
ti-tigr"at)
}cth(aeoFudxeto $){
ac PgNtonEcpin e
$hs>epne)>eSauCd(0)
ti-rsos(-stttsoe44;
$vnsit=$hs>rge(44)
eetLs
ti-tigr"0";
}cth(Ecpin$){
ac xeto e
$hs>epne)>eSauCd(0)
ti-rsos(-stttsoe50;
$vnsit=$hs>rge(50)
eetLs
ti-tigr"0";
}
}

rtr $vnsit
eun eetLs;
JUST TRY IT!
poetdfnto dsacUeRqet)
rtce ucin ipthsreus(
{
$vit=$hs>rge(rue,[rqet = $hs>eus(];
eLs
ti-tigr"ot" "eus" > ti-rqet))
$otMth=$vit>at)
rueac
eLs-ls(;
i (ul==$otMth {
f nl = rueac)
trwnwPgNtonEcpin"aentfud";
ho e aeoFudxeto(Pg o on!)
}
$hs>epne)>eSauCd(0)
ti-rsos(-stttsoe20;
$hs>rge(pefth,[rueac"= $otMth)
ti-tigr"r.ec" "otMth > rueac];
$otolr =$hs>vns)>rge(eeue,$otMth;
cnrles
ti-eet(-tigr"xct" rueac)
}

rtr $otolr;
eun cnrles

Why the "execute" trigger is different?
NOW IT WORKS!
pbi fnto tsBsAplw)
ulc ucin etaepFo(
{
$eus =Rqetatr:cetRqet"apg" "E";
rqet
eusFcoy:raeeus(/-ae, GT)
$p =nwAp)
ap
e p(;
$p-steus(rqet;
ap>eRqet$eus)
$p-stevcMngrnwZnevcMngrSrieaae()
ap>eSrieaae(e edSrieaaeevcMngr);
$p-stvnMngrnwZnvnMngrEetaae()
ap>eEetaae(e edEetaaevnMngr);
$epne=$p-rn)>epne)
rsos
ap>u(-rsos(;
}

$hs>setqas44 $epne>eSauCd()
ti-asrEul(0, rsos-gtttsoe);

.
O ( tss 1asrin)
K 1 et,
setos

See it on Github Gist
EASY TO MOCK!
pbi fnto tsORsosORueac(
ulc ucin etkepnenotMth)
{
$p =nwAp)
ap
e p(;
$vnMngr=nwZnvnMngrEetaae(;
eetaae
e edEetaaevnMngr)
$vnmngr>tah"ot" fnto( {
eetaae-atc(rue, ucin)
rtr nwRueac(]
eun e otMth[)
};
)
$p-stvnMngr$vnMngr;
ap>eEetaae(eetaae)
$p-stevcMngrnwZnevcMngrSrieaae()
ap>eSrieaae(e edSrieaaeevcMngr);
$epne=$p-rn)>epne)
rsos
ap>u(-rsos(;
}

$hs>setqas20 $epne>eSauCd()
ti-asrEul(0, rsos-gtttsoe);

.
.
O ( tss 2asrin)
K 2 et,
setos
WE NEED A BOOTSTRAPPER!
Or better, something that can prepare the event manager and
the service manager from a default configuration!
LINK DEFAULT LISTENERS
"itnr"= [
lsees >
"ot"= [
rue >
[ruelsee" "notEet]
"ot.itnr, oRuevn",
]
,
"edrr = [
rnee" >
[rnee.itnr,"edr]
"edrrlsee" rne",
]
,
"iih = [
fns" >
[rsos.itnr,"edepne]
"epnelsee" snRsos",
]
,
]
FRAMEWORK BASE SERVICES CONFIG
"lae"= [
aiss >
"ot.itnr
ruelsee"
= "itnrotLsee"
> LseeRueitnr,
"edrrlsee"= "itnredrrsn,
rnee.itnr > LseeRneeJo"
"epnelsee"= "itnredepneitnr,
rsos.itnr > LseeSnRsosLsee"
]
,
"atre"= [
fcois >
"itnrotLsee"= "evcRueitnratr"
LseeRueitnr > SrieotLseeFcoy,
]
,
"noals = [
ivkbe" >
"itnredrrsn
LseeRneeJo"
= "itnredrrsn,
> LseeRneeJo"
"itnredepneitnr = "itnredepneitnr,
LseeSnRsosLsee" > LseeSnRsosLsee"
]
,
THE ROUTER!
FOLLOW ZF2 IDEAS!
rtr [
eun
"otr = [
rue" >
"ots = [
rue" >
"oe = [
hm" >
"ye = "iea"
tp" > Ltrl,
"pin"= [
otos >
"ot"= ""
rue > /,
"eals = [
dfut" >
"otolr = "FaIay,
cnrle" > ZDytl"
"cin = "e21Dy
ato" > gt04a"
]
]
,
'a_emnt'= tu,
mytriae > re
]
]
]
]
;
ROUTE LISTENER
casRueitnr
ls otLsee
{
pbi fnto _cntut$otr
ulc ucin _osrc(rue)
{
$hs>otr=$otr
ti-rue
rue;
}
}

pbi fnto oRuevn(eet {..}
ulc ucin notEet$vn)
.

/Rueitnratr
/otLseeFcoy
$otr=TeRuetc:fcoy$ofg"otr];
rue
reotSak:atr(cni[rue")
$otLsee =nwRueitnr$otr;
rueitnr
e otLsee(rue)
$hs>tah"ot" [rueitnr "notEet];
ti-atc(rue, $otLsee, oRuevn")
ON ROUTE EVENT
pbi fnto oRuevn(eet
ulc ucin notEet$vn)
{
$agt=$vn-gtagt)
tre
eet>eTre(;
$eus =$vn-gtaa(rqet)
rqet
eet>ePrm"eus";
$ac =$hs>eRue(-mth$eus)
mth
ti-gtotr)>ac(rqet;
i (mth {
f $ac)
$c =$ac-gtaa(ato";
at
mth>ePrm"cin)
$tl=$ac-gtaa(cnrle";
cr
mth>ePrm"otolr)
i (tre-srie(-hs$tr){
f $agt>evcs)>a(cl)
$tl=$agt>evcs)>e(cl)
cr
tre-srie(-gt$tr;
}
$agt>vns)>tah"xct" [cr,$c];
tre-eet(-atc(eeue, $tl at)

}

}
rtr $ac;
eun mth
CONTROLLERS [ACTION LISTENERS]
Controllers are POPO objects that returns serializable data
nmsaeZa;
aepc FDy
casIay
ls tl
{
pbi fnto gt04a(
ulc ucin e21Dy)
{
rtr [
eun
"ak"= [
tls >
"is"= [
frt >
"il"= "utatte."
tte > Js
il..
]
]
,
..
.
]
;
}
}
BUT, POPOS ARE TOO SIMPLE
We want to use other services into actions!
pbi fnto tecin)
ulc ucin hAto(
{
/Ine asriehr!
/ ed
evc ee
$yevc =$hs>evcs)>e(m.evc";
mSrie
ti-srie(-gt"ysrie)
}

/uei..
/s t.

But how to do that?
CONTROLLERS USES
casTeotolr
ls hCnrle
{
ueSrieaae;
s evcMngr
pbi fnto tecin){
ulc ucin hAto(
$evc =$hs>evcs)>e(m.evc";
srie
ti-srie(-gt"ysrie)

}

}

..
.
TRAITS
tatSrieaae(
ri evcMngr)
{
piae$evcMngr
rvt srieaae;
pbi fnto stevcMngr$evcMngr
ulc ucin eSrieaae(srieaae)
{
$hs>evcMngr=$evcMngr
ti-srieaae
srieaae;
}

}

pbi fnto srie(
ulc ucin evcs)
{
rtr $hs>evcMngr
eun ti-srieaae;
}
ZENDSTDLIBHYDRATOR
$aa=[
dt
"evcMngr = $agt>evcs)
srieaae" > tre-srie(,
"vnMngr = $agt>vns)
eetaae" > tre-eet(,
"epne = $agt>epne)
rsos" > tre-rsos(,
"eus"= $agt>eus(,
rqet > tre-rqet)
]
;
$yrtr=nwedSdiyrtrCasehd(;
hdao
e ZntlbHdaolsMtos)
$yrtr>yrt(dt,$otolr;
hdao-hdae$aa cnrle)
AND ALSO CONTROLLERS AS SERVICES
"evcs = [
srie" >
"noals = [
ivkbe" >
"FaIay = "FaIay,
ZDytl" > ZDytl"
]
]
"atre"= [
fcois >
"FaIay = fnto(evcLctrnefc $l {
ZDytl" > ucinSrieoaoItrae s)
$otolr=nwFDyIay)
cnrle
e Zatl(;
$otolr>eMSrie$l>e(m.evc")
cnrle-styevc(s-gt"ysrie);

]

}
,
..
.

rtr $otolr
eun cnrle;

And all others ZF2 services opportunities
RENDERERS!
Serialize your data
JSON RENDERER
casJo
ls sn
{
pbi fnto rne(vn $vn)
ulc ucin edrEet eet
{
$agt=$vn-gtagt)
tre
eet>eTre(;
$aaak=$vn-gtaa(dt"-ls(
dtPc
eet>ePrm"aa)>at)
$epne=$agt>epne)
rsos
tre-rsos(;
$epne>dHaes[
rsos-adedr(
"otn-ye = "plcto/sn,
CnetTp" > apiainjo"
];
)

}

}

$epne>eCnetjo_noe$aaak)
rsos-stotn(snecd(dtPc);

/ Ap
/ p
$hs>vns)>tah"edr,[rnee,"edr];
ti-eet(-atc(rne" $edrr rne")
SEND RESPONSE TO THE CLIENT
It's an event of course!
EMIT!
casEi
ls mt
{
pbi fnto sn(eet
ulc ucin ed$vn)
{
$agt=$vn-gtagt)
tre
eet>eTre(;

}

}

$agt>epne)>ed)
tre-rsos(-sn(;

/Ap
/p
$hs>vns)>tah"iih,[eitr "ed];
ti-eet(-atc(fns" $mte, sn")

We can remove it or mock it out during testing!
SEE THE FIRST IMPLEMENTATION
The first impl
AT LEAST 3 RESPONSIBILITIES
BUT EFFECTIVELY MORE...

Configure the application
Prepare the application
Run the application
Single Responsibility Principle
REFACTOR THE FRAMEWORK
6d695f6 -> 87ad7e73
OK, RECAP!
EVENTS

ANY IDEAS?
PERFORMANCE INSPECTION & TRACKING
Symfony2 Stopwatch component
casSowthitnr
ls tpacLsee
pbi fnto sat$vn)
ulc ucin tr(eet
{
$xctoNm =gtcas$vn-gtagt);
eeuinae
e_ls(eet>eTre()
$hs>eSowth)>tr(eeuinae;
ti-gttpac(-sat$xctoNm)
}
pbi fnto lp$vn){..}
ulc ucin a(eet
.
pbi fnto so(eet
ulc ucin tp$vn)
{
$xctoNm =gtcas$vn-gtagt);
eeuinae
e_ls(eet>eTre()
$xcto =$hs>eSowth)>tp$xctoNm)
eeuin
ti-gttpac(-so(eeuinae;

}

}

/sn t DTDGSRIE LGES.
/ed o AAO EVC, OGR..

SmoyCmoetSowthSowth
yfnopnntpactpac
PERFORMANCE INSPECTION & TRACKING
"itnr"= [
lsees >
"ei"= [
bgn >
[lsee.tpac" "tr",
"itnrsowth, sat]
]
,
"r.ec"= [
pefth >
[lsee.tpac" "a",
"itnrsowth, lp]
]
,
"iih = [
fns" >
[lsee.tpac" "tp]
"itnrsowth, so",
]
,
]
"evcs = [
srie" >
"lae"= [
aiss >
"itnrsowth = "tpacLseeFcoy
lsee.tpac" > Sowthitnratr"
]
]
PERFORMANCE INSPECTION & TRACKING
PERFORMANCE INSPECTION & TRACKING
PERSONAL EVENTS
pbi fnto cnimusrpincin$otMthvn)
ulc ucin ofrSbcitoAto(rueacEet
{
$sr=nwUe(;
ue
e sr)
$sr>eNm(.)
ue-stae..;
..
.
$niyaae-prit$sr;
ettMngr>ess(ue)
$niyaae-fuh)
ettMngr>ls(;
}

$hs>vns)>rge(sbcie.e" $sr;
ti-eet(-tigr"usrbrnw, ue)

"itnr"= [
lsees >
"usrbrnw = [
sbcie.e" >
[sbcie.ade" "oiyiEal]
"usrbrhnlr, ntfVami"
[sascutr,"eSbcie"
"tt.one" nwusrbr]
]
]
MAINTENANCE PAGES
"itnr"= [
lsees >
"ot"= [
rue >
[mitnnelsees,"aneacPg"
"aneac.itnr" mitnneae]
]
,
"xct"= [
eeue >
[mitnnecnrle" "aneacAto"
"aneac.otolr, mitnnecin]
]
,
]
casMitnneotLsee
ls aneacRueitnr
{
pbi fnto mitnneaeEet$vn)
ulc ucin aneacPg(vn eet
{
rtr nwRueac(];
eun e otMth[)
}
}

Don't use this, there are better ways
TRY IT!
Fork it on Github
https://github.com/wdalmut/upcloo-web-framework
THANKS FOR LISTENING
ALWAYS EVENTS?
Author Walter Dal Mut / @walterdalmut

More Related Content

What's hot

穏やかにファイルを削除する
穏やかにファイルを削除する穏やかにファイルを削除する
穏やかにファイルを削除する
鉄次 尾形
 
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
Nuxeo
 
The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189
Mahmoud Samir Fayed
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJS
Adam Štipák
 
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays
 
Project hotel on hotel management fo
Project  hotel on hotel management foProject  hotel on hotel management fo
Project hotel on hotel management fo
Sunny Singhania
 
Serhii Korolenko - Passing Security By
Serhii Korolenko - Passing Security BySerhii Korolenko - Passing Security By
Serhii Korolenko - Passing Security By
NoNameCon
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
Phillip Trelford
 
Jamming attack in wireless network
Jamming attack in wireless networkJamming attack in wireless network
Jamming attack in wireless network
Thesis Scientist Private Limited
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
hasan0812
 
Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2
Prof Ansari
 
Augeas
AugeasAugeas
Augeas
lutter
 
Try Redis - interactive Tutorial
Try Redis - interactive TutorialTry Redis - interactive Tutorial
Try Redis - interactive Tutorial
简放 视野
 
Using Phing for Fun and Profit
Using Phing for Fun and ProfitUsing Phing for Fun and Profit
Using Phing for Fun and Profit
Nicholas Jansma
 
The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181
Mahmoud Samir Fayed
 

What's hot (20)

穏やかにファイルを削除する
穏やかにファイルを削除する穏やかにファイルを削除する
穏やかにファイルを削除する
 
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
 
The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJS
 
Yg byev2e
Yg byev2eYg byev2e
Yg byev2e
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
 
Project hotel on hotel management fo
Project  hotel on hotel management foProject  hotel on hotel management fo
Project hotel on hotel management fo
 
Serhii Korolenko - Passing Security By
Serhii Korolenko - Passing Security BySerhii Korolenko - Passing Security By
Serhii Korolenko - Passing Security By
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
Jamming attack in wireless network
Jamming attack in wireless networkJamming attack in wireless network
Jamming attack in wireless network
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
 
Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2
 
Augeas
AugeasAugeas
Augeas
 
Try Redis - interactive Tutorial
Try Redis - interactive TutorialTry Redis - interactive Tutorial
Try Redis - interactive Tutorial
 
Using Phing for Fun and Profit
Using Phing for Fun and ProfitUsing Phing for Fun and Profit
Using Phing for Fun and Profit
 
The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185
 
Arquillian Extensions
Arquillian ExtensionsArquillian Extensions
Arquillian Extensions
 
The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181
 
teste
testeteste
teste
 

Viewers also liked

Corley scalability
Corley scalabilityCorley scalability
Corley scalability
Corley S.r.l.
 
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Corley S.r.l.
 
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty GenovaScale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
Corley S.r.l.
 
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
MySQL - Scale Out @ CloudParty 2013 Milano Talent GardenMySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
Corley S.r.l.
 
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
Corley S.r.l.
 
Php & cloud computing
Php & cloud computingPhp & cloud computing
Php & cloud computing
Corley S.r.l.
 
Disaster Recovery - On-Premise & Cloud
Disaster Recovery - On-Premise & CloudDisaster Recovery - On-Premise & Cloud
Disaster Recovery - On-Premise & Cloud
Corley S.r.l.
 
An introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin ItalyAn introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin Italy
Corley S.r.l.
 
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Corley S.r.l.
 
Cloud computing & lamp applications
Cloud computing & lamp applicationsCloud computing & lamp applications
Cloud computing & lamp applications
Corley S.r.l.
 
Scale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic BeanstalkScale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic Beanstalk
Corley S.r.l.
 
React vs Angular2
React vs Angular2React vs Angular2
React vs Angular2
Corley S.r.l.
 
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Corley S.r.l.
 

Viewers also liked (13)

Corley scalability
Corley scalabilityCorley scalability
Corley scalability
 
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
Cloud party 2014 - Deploy your infrastructure with Saltstack - Salt Cloud wit...
 
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty GenovaScale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
 
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
MySQL - Scale Out @ CloudParty 2013 Milano Talent GardenMySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
 
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
From Chef to Saltstack on Cloud Providers - Incontro DevOps 2015
 
Php & cloud computing
Php & cloud computingPhp & cloud computing
Php & cloud computing
 
Disaster Recovery - On-Premise & Cloud
Disaster Recovery - On-Premise & CloudDisaster Recovery - On-Premise & Cloud
Disaster Recovery - On-Premise & Cloud
 
An introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin ItalyAn introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin Italy
 
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
 
Cloud computing & lamp applications
Cloud computing & lamp applicationsCloud computing & lamp applications
Cloud computing & lamp applications
 
Scale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic BeanstalkScale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic Beanstalk
 
React vs Angular2
React vs Angular2React vs Angular2
React vs Angular2
 
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
 

Similar to Build a custom (micro)framework with ZF2 Components (as building blocks)

R57shell
R57shellR57shell
R57shell
ady36
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
Ari Lerner
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
Somenath Mukhopadhyay
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and myths
Wojciech Sznapka
 
Ae internals
Ae internalsAe internals
Ae internals
mnikolenko
 
Climbing the Abstract Syntax Tree (php[world] 2019)
Climbing the Abstract Syntax Tree (php[world] 2019)Climbing the Abstract Syntax Tree (php[world] 2019)
Climbing the Abstract Syntax Tree (php[world] 2019)
James Titcumb
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type Plugin
Jan Wilson
 
Angular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental FeatureAngular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental Feature
Jonathan Magen
 
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
James Titcumb
 
Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)
James Titcumb
 
Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)
James Titcumb
 
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
James Titcumb
 
Proxy OOP Pattern in PHP
Proxy OOP Pattern in PHPProxy OOP Pattern in PHP
Proxy OOP Pattern in PHP
Marco Pivetta
 
Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)
James Titcumb
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
James Titcumb
 
Building Maintainable Applications in Apex
Building Maintainable Applications in ApexBuilding Maintainable Applications in Apex
Building Maintainable Applications in Apex
Jeffrey Kemp
 
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
James Titcumb
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
ady36
 
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
James Titcumb
 
Erlang with Regexp Perl And Port
Erlang with Regexp Perl And PortErlang with Regexp Perl And Port
Erlang with Regexp Perl And Port
Keiichi Daiba
 

Similar to Build a custom (micro)framework with ZF2 Components (as building blocks) (20)

R57shell
R57shellR57shell
R57shell
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and myths
 
Ae internals
Ae internalsAe internals
Ae internals
 
Climbing the Abstract Syntax Tree (php[world] 2019)
Climbing the Abstract Syntax Tree (php[world] 2019)Climbing the Abstract Syntax Tree (php[world] 2019)
Climbing the Abstract Syntax Tree (php[world] 2019)
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type Plugin
 
Angular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental FeatureAngular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental Feature
 
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
 
Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)
 
Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)
 
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
 
Proxy OOP Pattern in PHP
Proxy OOP Pattern in PHPProxy OOP Pattern in PHP
Proxy OOP Pattern in PHP
 
Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
 
Building Maintainable Applications in Apex
Building Maintainable Applications in ApexBuilding Maintainable Applications in Apex
Building Maintainable Applications in Apex
 
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
 
Erlang with Regexp Perl And Port
Erlang with Regexp Perl And PortErlang with Regexp Perl And Port
Erlang with Regexp Perl And Port
 

More from Corley S.r.l.

Aws rekognition - riconoscimento facciale
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento facciale
Corley S.r.l.
 
AWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container services
Corley S.r.l.
 
AWSome day 2018 - API serverless with aws
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with aws
Corley S.r.l.
 
AWSome day 2018 - database in cloud
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
Corley S.r.l.
 
Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing
Corley S.r.l.
 
Apiconf - The perfect REST solution
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solution
Corley S.r.l.
 
Apiconf - Doc Driven Development
Apiconf - Doc Driven DevelopmentApiconf - Doc Driven Development
Apiconf - Doc Driven Development
Corley S.r.l.
 
Authentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
Corley S.r.l.
 
Flexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructuresFlexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructures
Corley S.r.l.
 
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
Corley S.r.l.
 
A single language for backend and frontend from AngularJS to cloud with Clau...
A single language for backend and frontend  from AngularJS to cloud with Clau...A single language for backend and frontend  from AngularJS to cloud with Clau...
A single language for backend and frontend from AngularJS to cloud with Clau...
Corley S.r.l.
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
Corley S.r.l.
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
Corley S.r.l.
 
Angular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deployAngular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
Corley S.r.l.
 
Corley cloud angular in cloud
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
Corley S.r.l.
 
Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2
Corley S.r.l.
 
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS LambdaRead Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Corley S.r.l.
 
Cloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT ApplicationsCloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT Applications
Corley S.r.l.
 
AngularJS advanced project management
AngularJS advanced project managementAngularJS advanced project management
AngularJS advanced project management
Corley S.r.l.
 
Raspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentRaspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application Development
Corley S.r.l.
 

More from Corley S.r.l. (20)

Aws rekognition - riconoscimento facciale
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento facciale
 
AWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container services
 
AWSome day 2018 - API serverless with aws
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with aws
 
AWSome day 2018 - database in cloud
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
 
Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing
 
Apiconf - The perfect REST solution
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solution
 
Apiconf - Doc Driven Development
Apiconf - Doc Driven DevelopmentApiconf - Doc Driven Development
Apiconf - Doc Driven Development
 
Authentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
 
Flexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructuresFlexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructures
 
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
 
A single language for backend and frontend from AngularJS to cloud with Clau...
A single language for backend and frontend  from AngularJS to cloud with Clau...A single language for backend and frontend  from AngularJS to cloud with Clau...
A single language for backend and frontend from AngularJS to cloud with Clau...
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
Angular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deployAngular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
 
Corley cloud angular in cloud
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
 
Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2
 
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS LambdaRead Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
 
Cloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT ApplicationsCloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT Applications
 
AngularJS advanced project management
AngularJS advanced project managementAngularJS advanced project management
AngularJS advanced project management
 
Raspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentRaspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application Development
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 

Build a custom (micro)framework with ZF2 Components (as building blocks)

  • 1. ZFDAY - 2014 BUILD A CUSTOM (MICRO)FRAMEWORK WITH ZF2 COMPONENTS AS BUILDING BLOCKS Author Walter Dal Mut / @walterdalmut
  • 2. WHO AM I? Walter Dal Mut, I work at Corley S.r.l. and also at UpCloo Ltd. You can contact me at: walter.dalmut@gmail.com On Twitter: @walterdalmut On GitHub: wdalmut
  • 3. WHY A CUSTOM FRAMEWORK? Tipically because we want to solve a particular problem. ZendFramework is a general purpose Web Framework that can fit different problems easily.
  • 4. IT SOUNDS LIKE REINVENTING THE WHEEL NO, WE DON'T WANT! We will use ZF2 components as building blocks We will drive a personal behaviour
  • 6. REQUIREMENTS Event Driven Design Dependency Inversion Principle TESTABLE/TDD
  • 7. EVENT DRIVEN DESIGN All framework operations are events (like ZF2)
  • 8. DEPENDENCY INVERSION We will focus on Service Manager
  • 9. [ WE WANT TO TEST OUR APPLICATIONS ]
  • 10. COMPOSE IT! { } "eur" { rqie: "edrmwr/edeetaae" "." znfaeokzn-vnmngr: 2*, "edrmwr/edsrieaae" "." znfaeokzn-evcmngr: 2*, "edrmwr/edmc:"." znfaeokzn-v" 2*, "edrmwr/edht" "." znfaeokzn-tp: 2* } , "eur-e" { rqiedv: "hui/hui" ".." ppntppnt: 37* } ,
  • 11. LET'S GO TO SCHOOL We have to learn our building blocks!
  • 12. THE EVENT MANAGER $vnMngr=nwZnvnMngrEetaae(; eetaae e edEetaaevnMngr) / Tigra eet / rge n vn pbi fnto tigr$vn,$agt=nl,$rv=nl) ulc ucin rge(eet tre ul ag ul; / Atc alsee t a eet / tah itnr o n vn pbi fnto atc(eet $alak $roiy; ulc ucin tah$vn, clbc, pirt) There are many other methods (detach, triggerUntil, etc...) See it on Github
  • 13. HOW EVENT MANAGER WORKS? pbi fnto tsEetaae( ulc ucin etvnMngr) { $v =nwEetaae(; e e vnMngr) $sald=fle iCle as; $v>tah'neet,fnto(eet ue($sald { e-atc(a-vn' ucin$vn) s &iCle) $sald=tu; iCle re }; ) $v>rge(a-vn"; e-tigr"neet) } $hs>setre$sald; ti-asrTu(iCle)
  • 14. THE SERVICE LOCATOR $evcMngr=nwZnevcMngrSrieaae(; srieaae e edSrieaaeevcMngr) "evcs = [ srie" > "noals = [ ivkbe" > "oraeop = "oraeop, YuNmCm" > YuNmCm" ] , "atre"= [ fcois > "oraeevc"= "oraeevcFcoy, YuNmSrie > YuNmSrieatr" ] , "lae"= [ aiss > "orais = "oraeevc" yu.la" > YuNmSrie, ] ] See it on Github
  • 15. CONFIGURE S.L. FROM ARRAY $evcMngr=nwZnevcMngrSrieaae(; srieaae e edSrieaaeevcMngr) $ofg=nwZnevcMngrCni( cni e edSrieaaeofg[ "noals = [.] ivkbe" > .., "atre"= [.] fcois > .., "btatfcois = [.] asrc_atre" > .., "lae"= [.] aiss > .. ] ) $ofg>ofgrSrieaae(srieaae) cni-cniueevcMngr$evcMngr;
  • 16. HOW SERVICE MANAGER WORKS? pbi fnto tsSrieaae( ulc ucin etevcMngr) { $m=nwSrieaae(; s e evcMngr) $hs>ofg>ofgrSrieaae(s) ti-cni-cniueevcMngr$m; $hs>setre$m>a(eape); ti-asrTu(s-hs"xml") } $hs>setae ti-asrSm( $m>e(eape) s-gt"xml", $m>e(eape) s-gt"xml" ) ;
  • 17. THE ROUTER $t =ZnvotrHtreotSak:atr(ra $ofg; rr edMcRuetpTeRuetc:fcoyary cni) "ots = [ rue" > "otNm"= [ rueae > "ye = "iea" tp" > Ltrl, "pin"= [ otos > "ot"= "pt" rue > /ah, "eals = [ dfut" > "otolr = "Fae, cnrle" > ZNm" "cin =>"cinae, ato" atoNm" ] ] , "a_emnt"= tu, mytriae > re ] ] $otMth=$t-mthRqet$eus) rueac rr>ac(eus rqet;
  • 18. HOW ROUTER WORKS? pbi fnto tsRueac( ulc ucin etotMth) { $otr=TeRuetc:fcoy$hs>ofg; rue reotSak:atr(ti-cni) $eus =nwRqet"pt"; rqet e eus(/ah) $otMth=$otr>ac(rqet; rueac rue-mth$eus) $otolrae=$otrac-gtaa(cnrle"; cnrleNm rueMth>ePrm"otolr) $cinae=$otMth>ePrm"cin) atoNm rueac-gtaa(ato"; } $hs>setqas"Fae,$otolrae) ti-asrEul(ZNm" cnrleNm) $hs>setqas"cinae,$cinae) ti-asrEul(atoNm" atoNm)
  • 21. HYDRATORS pbi fnto etat$bet; ulc ucin xrc(ojc) pbi fnto hdaeary$aa $bet; ulc ucin yrt(ra dt, ojc) $lsMtos=nwedSdiyrtrCasehd(; casehd e ZntlbHdaolsMtos) $betrp=nwedSdiyrtobetrpry) ojcPo e ZntlbHdarrOjcPoet(; $ra =nwedSdiyrtoraSraial(; ary e ZntlbHdarrAryeilzbe)
  • 24. THE FRAMEWORK EVENTS LIST BEGIN The loop begins ROUTE Parse the actual route in order to found a dispatchable action PRE.FETCH Before dispatch the action EXECUTE Dispatch all actions RENDER Render your data FINISH The loop ends
  • 26. TEST IT! pbi fnto tsBsAplw) ulc ucin etaepFo( { $eus =Rqetatr:cetRqet"vldul,"E" [) rqet eusFcoy:raeeus(/ai-r" GT, ]; $p =nwAp) ap e p(; $p-steus(rqet; ap>eRqet$eus) $p-stevcMngrnwZnevcMngrSrieaae() ap>eSrieaae(e edSrieaaeevcMngr); $p-stvnMngrnwZnvnMngrEetaae() ap>eEetaae(e edEetaaevnMngr); $epne=$p-rn)>epne) rsos ap>u(-rsos(; } $hs>setqas44 $epne>eSauCd() ti-asrEul(0, rsos-gtttsoe); F FI ( tss 1asrin) AL 1 et, setos
  • 27. REQUEST pbi fnto steus(eus $eus) ulc ucin eRqetRqet rqet { $hs>eus =$eus; ti-rqet rqet } pbi fnto rqet) ulc ucin eus( { i ($hs>eus){ f !ti-rqet $hs>eus =nwRqet) ti-rqet e eus(; } } rtr $hs>eus; eun ti-rqet
  • 28. RESPONSE pbi fnto stepneRsos $epne ulc ucin eRsos(epne rsos) { $hs>epne=$epne ti-rsos rsos; } pbi fnto rsos( ulc ucin epne) { i ($hs>epne { f !ti-rsos) $hs>epne=nwRsos(; ti-rsos e epne) } } rtr $hs>epne eun ti-rsos;
  • 29. EVENT MANAGER pbi fnto stvnMngr$vnMngr ulc ucin eEetaae(eetaae) { $hs>vnMngr=$vnMngr ti-eetaae eetaae; } pbi fnto eet( ulc ucin vns) { rtr $hs>vnMngr eun ti-eetaae; }
  • 30. EVENT TRIGGER HELPER pbi fnto tigr$ae ary$aas=[) ulc ucin rge(nm, ra prm ] { $vn =nwEet) eet e vn(; $vn-stagt$hs; eet>eTre(ti) $vn-staas$aas; eet>ePrm(prm) } rtr $hs>vns)>rge(nm,$vn) eun ti-eet(-tigr$ae eet;
  • 31. SERVICE MANAGER pbi fnto stevcMngr$evcMngr ulc ucin eSrieaae(srieaae) { $hs>evcMngr=$evcMngr ti-srieaae srieaae; } pbi fnto srie( ulc ucin evcs) { rtr $hs>evcMngr eun ti-srieaae; }
  • 32. ENTRY POINT! pbi fnto rn) ulc ucin u( { $hs>rge(bgn) ti-tigr"ei"; $vnsit=$hs>ipthsrcineaeEet(; eetLs ti-dsacUeAtoRltdvns) $hs>rge(rne" [dt"= $vnsit) ti-tigr"edr, "aa > eetLs]; $hs>rge(fns"; ti-tigr"iih) } rtr $hs eun ti;
  • 33. HEY, CAN YOU DO IT? poetdfnto dsacUeAtoRltdvns) rtce ucin ipthsrcineaeEet( { ty{ r $vnsit=$hs>ipthsreus(; eetLs ti-dsacUeRqet) }cth(atxeto $){ ac HlEcpin e $vnsit=$hs>rge(hl"; eetLs ti-tigr"at) }cth(aeoFudxeto $){ ac PgNtonEcpin e $hs>epne)>eSauCd(0) ti-rsos(-stttsoe44; $vnsit=$hs>rge(44) eetLs ti-tigr"0"; }cth(Ecpin$){ ac xeto e $hs>epne)>eSauCd(0) ti-rsos(-stttsoe50; $vnsit=$hs>rge(50) eetLs ti-tigr"0"; } } rtr $vnsit eun eetLs;
  • 34. JUST TRY IT! poetdfnto dsacUeRqet) rtce ucin ipthsreus( { $vit=$hs>rge(rue,[rqet = $hs>eus(]; eLs ti-tigr"ot" "eus" > ti-rqet)) $otMth=$vit>at) rueac eLs-ls(; i (ul==$otMth { f nl = rueac) trwnwPgNtonEcpin"aentfud"; ho e aeoFudxeto(Pg o on!) } $hs>epne)>eSauCd(0) ti-rsos(-stttsoe20; $hs>rge(pefth,[rueac"= $otMth) ti-tigr"r.ec" "otMth > rueac]; $otolr =$hs>vns)>rge(eeue,$otMth; cnrles ti-eet(-tigr"xct" rueac) } rtr $otolr; eun cnrles Why the "execute" trigger is different?
  • 35. NOW IT WORKS! pbi fnto tsBsAplw) ulc ucin etaepFo( { $eus =Rqetatr:cetRqet"apg" "E"; rqet eusFcoy:raeeus(/-ae, GT) $p =nwAp) ap e p(; $p-steus(rqet; ap>eRqet$eus) $p-stevcMngrnwZnevcMngrSrieaae() ap>eSrieaae(e edSrieaaeevcMngr); $p-stvnMngrnwZnvnMngrEetaae() ap>eEetaae(e edEetaaevnMngr); $epne=$p-rn)>epne) rsos ap>u(-rsos(; } $hs>setqas44 $epne>eSauCd() ti-asrEul(0, rsos-gtttsoe); . O ( tss 1asrin) K 1 et, setos See it on Github Gist
  • 36. EASY TO MOCK! pbi fnto tsORsosORueac( ulc ucin etkepnenotMth) { $p =nwAp) ap e p(; $vnMngr=nwZnvnMngrEetaae(; eetaae e edEetaaevnMngr) $vnmngr>tah"ot" fnto( { eetaae-atc(rue, ucin) rtr nwRueac(] eun e otMth[) }; ) $p-stvnMngr$vnMngr; ap>eEetaae(eetaae) $p-stevcMngrnwZnevcMngrSrieaae() ap>eSrieaae(e edSrieaaeevcMngr); $epne=$p-rn)>epne) rsos ap>u(-rsos(; } $hs>setqas20 $epne>eSauCd() ti-asrEul(0, rsos-gtttsoe); . . O ( tss 2asrin) K 2 et, setos
  • 37. WE NEED A BOOTSTRAPPER! Or better, something that can prepare the event manager and the service manager from a default configuration!
  • 38. LINK DEFAULT LISTENERS "itnr"= [ lsees > "ot"= [ rue > [ruelsee" "notEet] "ot.itnr, oRuevn", ] , "edrr = [ rnee" > [rnee.itnr,"edr] "edrrlsee" rne", ] , "iih = [ fns" > [rsos.itnr,"edepne] "epnelsee" snRsos", ] , ]
  • 39. FRAMEWORK BASE SERVICES CONFIG "lae"= [ aiss > "ot.itnr ruelsee" = "itnrotLsee" > LseeRueitnr, "edrrlsee"= "itnredrrsn, rnee.itnr > LseeRneeJo" "epnelsee"= "itnredepneitnr, rsos.itnr > LseeSnRsosLsee" ] , "atre"= [ fcois > "itnrotLsee"= "evcRueitnratr" LseeRueitnr > SrieotLseeFcoy, ] , "noals = [ ivkbe" > "itnredrrsn LseeRneeJo" = "itnredrrsn, > LseeRneeJo" "itnredepneitnr = "itnredepneitnr, LseeSnRsosLsee" > LseeSnRsosLsee" ] ,
  • 41. FOLLOW ZF2 IDEAS! rtr [ eun "otr = [ rue" > "ots = [ rue" > "oe = [ hm" > "ye = "iea" tp" > Ltrl, "pin"= [ otos > "ot"= "" rue > /, "eals = [ dfut" > "otolr = "FaIay, cnrle" > ZDytl" "cin = "e21Dy ato" > gt04a" ] ] , 'a_emnt'= tu, mytriae > re ] ] ] ] ;
  • 42. ROUTE LISTENER casRueitnr ls otLsee { pbi fnto _cntut$otr ulc ucin _osrc(rue) { $hs>otr=$otr ti-rue rue; } } pbi fnto oRuevn(eet {..} ulc ucin notEet$vn) . /Rueitnratr /otLseeFcoy $otr=TeRuetc:fcoy$ofg"otr]; rue reotSak:atr(cni[rue") $otLsee =nwRueitnr$otr; rueitnr e otLsee(rue) $hs>tah"ot" [rueitnr "notEet]; ti-atc(rue, $otLsee, oRuevn")
  • 43. ON ROUTE EVENT pbi fnto oRuevn(eet ulc ucin notEet$vn) { $agt=$vn-gtagt) tre eet>eTre(; $eus =$vn-gtaa(rqet) rqet eet>ePrm"eus"; $ac =$hs>eRue(-mth$eus) mth ti-gtotr)>ac(rqet; i (mth { f $ac) $c =$ac-gtaa(ato"; at mth>ePrm"cin) $tl=$ac-gtaa(cnrle"; cr mth>ePrm"otolr) i (tre-srie(-hs$tr){ f $agt>evcs)>a(cl) $tl=$agt>evcs)>e(cl) cr tre-srie(-gt$tr; } $agt>vns)>tah"xct" [cr,$c]; tre-eet(-atc(eeue, $tl at) } } rtr $ac; eun mth
  • 44. CONTROLLERS [ACTION LISTENERS] Controllers are POPO objects that returns serializable data nmsaeZa; aepc FDy casIay ls tl { pbi fnto gt04a( ulc ucin e21Dy) { rtr [ eun "ak"= [ tls > "is"= [ frt > "il"= "utatte." tte > Js il.. ] ] , .. . ] ; } }
  • 45. BUT, POPOS ARE TOO SIMPLE We want to use other services into actions! pbi fnto tecin) ulc ucin hAto( { /Ine asriehr! / ed evc ee $yevc =$hs>evcs)>e(m.evc"; mSrie ti-srie(-gt"ysrie) } /uei.. /s t. But how to do that?
  • 46. CONTROLLERS USES casTeotolr ls hCnrle { ueSrieaae; s evcMngr pbi fnto tecin){ ulc ucin hAto( $evc =$hs>evcs)>e(m.evc"; srie ti-srie(-gt"ysrie) } } .. .
  • 47. TRAITS tatSrieaae( ri evcMngr) { piae$evcMngr rvt srieaae; pbi fnto stevcMngr$evcMngr ulc ucin eSrieaae(srieaae) { $hs>evcMngr=$evcMngr ti-srieaae srieaae; } } pbi fnto srie( ulc ucin evcs) { rtr $hs>evcMngr eun ti-srieaae; }
  • 48. ZENDSTDLIBHYDRATOR $aa=[ dt "evcMngr = $agt>evcs) srieaae" > tre-srie(, "vnMngr = $agt>vns) eetaae" > tre-eet(, "epne = $agt>epne) rsos" > tre-rsos(, "eus"= $agt>eus(, rqet > tre-rqet) ] ; $yrtr=nwedSdiyrtrCasehd(; hdao e ZntlbHdaolsMtos) $yrtr>yrt(dt,$otolr; hdao-hdae$aa cnrle)
  • 49. AND ALSO CONTROLLERS AS SERVICES "evcs = [ srie" > "noals = [ ivkbe" > "FaIay = "FaIay, ZDytl" > ZDytl" ] ] "atre"= [ fcois > "FaIay = fnto(evcLctrnefc $l { ZDytl" > ucinSrieoaoItrae s) $otolr=nwFDyIay) cnrle e Zatl(; $otolr>eMSrie$l>e(m.evc") cnrle-styevc(s-gt"ysrie); ] } , .. . rtr $otolr eun cnrle; And all others ZF2 services opportunities
  • 51. JSON RENDERER casJo ls sn { pbi fnto rne(vn $vn) ulc ucin edrEet eet { $agt=$vn-gtagt) tre eet>eTre(; $aaak=$vn-gtaa(dt"-ls( dtPc eet>ePrm"aa)>at) $epne=$agt>epne) rsos tre-rsos(; $epne>dHaes[ rsos-adedr( "otn-ye = "plcto/sn, CnetTp" > apiainjo" ]; ) } } $epne>eCnetjo_noe$aaak) rsos-stotn(snecd(dtPc); / Ap / p $hs>vns)>tah"edr,[rnee,"edr]; ti-eet(-atc(rne" $edrr rne")
  • 52. SEND RESPONSE TO THE CLIENT It's an event of course!
  • 53. EMIT! casEi ls mt { pbi fnto sn(eet ulc ucin ed$vn) { $agt=$vn-gtagt) tre eet>eTre(; } } $agt>epne)>ed) tre-rsos(-sn(; /Ap /p $hs>vns)>tah"iih,[eitr "ed]; ti-eet(-atc(fns" $mte, sn") We can remove it or mock it out during testing!
  • 54. SEE THE FIRST IMPLEMENTATION The first impl
  • 55. AT LEAST 3 RESPONSIBILITIES BUT EFFECTIVELY MORE... Configure the application Prepare the application Run the application Single Responsibility Principle
  • 59. PERFORMANCE INSPECTION & TRACKING Symfony2 Stopwatch component casSowthitnr ls tpacLsee pbi fnto sat$vn) ulc ucin tr(eet { $xctoNm =gtcas$vn-gtagt); eeuinae e_ls(eet>eTre() $hs>eSowth)>tr(eeuinae; ti-gttpac(-sat$xctoNm) } pbi fnto lp$vn){..} ulc ucin a(eet . pbi fnto so(eet ulc ucin tp$vn) { $xctoNm =gtcas$vn-gtagt); eeuinae e_ls(eet>eTre() $xcto =$hs>eSowth)>tp$xctoNm) eeuin ti-gttpac(-so(eeuinae; } } /sn t DTDGSRIE LGES. /ed o AAO EVC, OGR.. SmoyCmoetSowthSowth yfnopnntpactpac
  • 60. PERFORMANCE INSPECTION & TRACKING "itnr"= [ lsees > "ei"= [ bgn > [lsee.tpac" "tr", "itnrsowth, sat] ] , "r.ec"= [ pefth > [lsee.tpac" "a", "itnrsowth, lp] ] , "iih = [ fns" > [lsee.tpac" "tp] "itnrsowth, so", ] , ] "evcs = [ srie" > "lae"= [ aiss > "itnrsowth = "tpacLseeFcoy lsee.tpac" > Sowthitnratr" ] ]
  • 63. PERSONAL EVENTS pbi fnto cnimusrpincin$otMthvn) ulc ucin ofrSbcitoAto(rueacEet { $sr=nwUe(; ue e sr) $sr>eNm(.) ue-stae..; .. . $niyaae-prit$sr; ettMngr>ess(ue) $niyaae-fuh) ettMngr>ls(; } $hs>vns)>rge(sbcie.e" $sr; ti-eet(-tigr"usrbrnw, ue) "itnr"= [ lsees > "usrbrnw = [ sbcie.e" > [sbcie.ade" "oiyiEal] "usrbrhnlr, ntfVami" [sascutr,"eSbcie" "tt.one" nwusrbr] ] ]
  • 64. MAINTENANCE PAGES "itnr"= [ lsees > "ot"= [ rue > [mitnnelsees,"aneacPg" "aneac.itnr" mitnneae] ] , "xct"= [ eeue > [mitnnecnrle" "aneacAto" "aneac.otolr, mitnnecin] ] , ] casMitnneotLsee ls aneacRueitnr { pbi fnto mitnneaeEet$vn) ulc ucin aneacPg(vn eet { rtr nwRueac(]; eun e otMth[) } } Don't use this, there are better ways
  • 65. TRY IT! Fork it on Github https://github.com/wdalmut/upcloo-web-framework
  • 66. THANKS FOR LISTENING ALWAYS EVENTS? Author Walter Dal Mut / @walterdalmut