34
code.talks commerce 19/20.04.2016

Spryker in a nutshell

Embed Size (px)

Citation preview

Page 1: Spryker in a nutshell

code.talks  commerce  19/20.04.2016    

Page 2: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   2  

About  me  

2  

Fabian  Wesner  CTO  Spryker  Systems    Twi-er  hAps://twiAer.com/FabianWesner    Spryker  Techblog  hAps://tech.spryker.com      This  presentaHon  is  available  on  Slideshare:  hAp://de.slideshare.net/FabianWesner  

Page 3: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   3  

MoHvaHon  Why  do  we  need  an  (e)commerce  framework?  

Page 4: Spryker in a nutshell

Shop  system  usage  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   4  

StaHsta  

askhivemind  

Although  there  are  lots  of  shop  systems,  many  merchants  decide  to  build  their  own?  Why?  

Page 5: Spryker in a nutshell

Standard  Shop-­‐soQware  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   5  

Standard  shop  soQware  offer  many  features  that  can  be  configured  and  some  hooks  for  extensions.  

è Enough  for  the  long  tail  of  merchants.  

 

 

But  …  

Page 6: Spryker in a nutshell

Framework  vs  Shop-­‐soQware  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   6  

Standardized  shop  soQware  offer  many  features  that  can  be  configured  and  some  hooks  for  extensions.  

è Enough  for  the  long  tail  of  merchants.  

 

 

But  that  doesn’t  fit  for  ambi1ous  projects!  If  your  business  model  is  not  standardized,  a  standard  shop  so=ware  does  not  help  you!  

Page 7: Spryker in a nutshell

The  framework  approach  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   7  

   

Instead  an  out-­‐of-­‐the-­‐box  shop  soQware  ambiHous  projects  need  a  framework,  that  op8mizes  the  developers’  produc8vity.    

How?  

Page 8: Spryker in a nutshell

Increased  developer’s  producHvity  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   8  

✔  Clean  and  SOLID  code  ✔  Consistent  soQware  design  ✔  Strict  modularizaHon  

✔  Generic  set  of  features  (like  state  machines)  

✔  High  performance  and  scalability  

✔  DeterminisHc  behavior  

✔  Tested  and  measured  code  

✔  Avoidance  of  bad  pracHces    Like  full  page  cache,  EAV,  event-­‐dispatcher,  AOP,  code  configuraHon  in  database,  dependency-­‐container  magic,  …  

 

 

Page 9: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   9  

IntroducHon  

Page 10: Spryker in a nutshell

Spryker  Bird’s  eye  view  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   10  

Page 11: Spryker in a nutshell

Performance  &  Scalability  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   11  

Lightweight  shop  frontend  Yves  executes  in  30  -­‐  100ms    •  No  full  page  cache  needed!  

•  Redis  and  ElasHcsearch  are  easily  scalable  •  No  direct  access  to  SQL  database  from  frontend  (to  avoid  the  boAleneck)  

Page 12: Spryker in a nutshell

Code  principles  and  quality  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   12  

Spryker  follows  the    SOLID-­‐  and  Packaging-­‐Principles.  

Spryker  implements  Clean  Code!  

Project  boilerplate  

Core  -­‐  Bundles  

Page 13: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   13  

SoQware  design  

Page 14: Spryker in a nutshell

First  sketch  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   14  

Page 15: Spryker in a nutshell

Architectural  thinking  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   15  

Single  applica8on  approach  •  Runs  on  every  laptop  

•  “Just  a  PHP  applicaHon”  

•  Quick  and  simple  deployment  

 

 

Service  approach  •  High  producHvity  with  large  teams  with  big  

projects  

•  Update,  replace  or  extend  parts  of  the  applicaHon  

 

 

Page 16: Spryker in a nutshell

Architectural  thinking  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   16  

Single  applica8on  approach  •  Runs  on  every  laptop  

•  “Just  a  PHP  applicaHon”  

•  Quick  and  simple  deployment  

 

 

Service  approach  •  High  producHvity  with  large  teams  with  big  

projects  

•  Update,  replace  or  extend  parts  of  the  applicaHon  

 

 Not  required/wanted:  •  Technology  zoo  

•  Overhead  of  distribuHon  and  asynchronous  communicaHon  

•  MulHple  database  without  transacHons  and  consistency  

Page 17: Spryker in a nutshell

Monolith?  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   17  

Page 18: Spryker in a nutshell

Modular  ApplicaHon  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   18  

Bundles  which  have  a  single  responsibility  with  well-­‐defined  relaHonships.  

Page 19: Spryker in a nutshell

Each  bundle  consists  of  (up  to)  4  layers  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   19  

Page 20: Spryker in a nutshell

ApplicaHons,  bundles  and  layers  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   20  

Page 21: Spryker in a nutshell

Each  bundle  has  an  internal  API  (~  Facade)  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   21  

Page 22: Spryker in a nutshell

Bundle  to  Bundle  communicaHon  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   22  

Page 23: Spryker in a nutshell

Strict  modularizaHon  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   23  

A  bundle  is  a  “funcHonal  unit”.  

 Bundles  are  loose  coupled,  coherent  and  have  explicit  dependencies.  

 

They  follow  the  packaging  principles!  

 

Currently  there  are  >  100  bundles.  

 

Main  benefit:  Code  keeps  well-­‐structured  even  in  big  projects  with  large  development  teams.    

Page 24: Spryker in a nutshell

Atomic  Releases  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   24  

Each  bundle  has  it’s  own  (semanHc)  version  number  and  own  (split)  repository.  

 We  know:  Migra8on  to  a  new  version  can  be  painful!    That’s  why:  all  releases  only  affect  one  or  some  bundles  (Isolated  changes).  

 

Spryker  offers  a  con8nuous  delivery  of    Atomic  Releases.    

 

Page 25: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   25  

Programming  with  Spryker  

Page 26: Spryker in a nutshell

Dependency  injecHon  with  factories  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   26  

+  Explicit  injecHon  without  background  magic.  IDE-­‐friendly  +  Separated  factories  per  bundle/layer.  No  big  DI-­‐container.  

Page 27: Spryker in a nutshell

Extension  with  plugins  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   27  

Page 28: Spryker in a nutshell

Project  extension  via  object  composiHon  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   28  

+  You  can  extend  every  class  by  composiHon  (recommended)  or  inheritance.  

Page 29: Spryker in a nutshell

Transfer  objects  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   29  

+  Internal  data  transfer  with  objects,  not  anonymous  arrays.  +  Clear  separaHon  of  data  and  logic  

Usage

 Defi

niHo

n  

Page 30: Spryker in a nutshell

State  machines  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   30  

Visual  programming  with  state  machines  •  Graph  in  XML  •  Commands  and  

CondiHons  in  PHP  

 

Perfect  use  case    Automated  processing  of  orders.  Avoid  bulky  ERP  as  much  as  possible.  

Page 31: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   31  

Run  Spryker  –  Now        Installa8on  guide:  hAp://start.spryker.com  InstallaHon  with  Vagrant  VM    

takes  20-­‐30  minutes  

 All  Github  repositories  are  public:  hAps://github.com/spryker  

 

Page 32: Spryker in a nutshell

More  Spryker  links  

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   32  

Documenta8on  –  Spryker  has  comprehensive  documentaHon  hAp://spryker.github.io    Forum  –  Ask  any  quesHon  to  the  Spryker  team  

hAp://discuss.spryker.com  

 

Techblog  –  Get  deep  insights  from  the  core  team  

hAps://tech.spryker.com  

 

Scru8nizer  (Yves)  –  Check  the  code  quality  metrics  hAps://scruHnizer-­‐ci.com/g/spryker/demoshop  

 

Page 33: Spryker in a nutshell

2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016   33  

A  proven  technology  built  in  real-­‐world  projects  for  ambiHous  and  non-­‐standard  business  models.    

Page 34: Spryker in a nutshell

Spryker  Systems  GmbH  Julie-­‐WolQhorn-­‐Strasse  1  

10115  Berlin  Germany  

[email protected]    Phone:  +49  40  328  929  631  

Fax:  +49  40  328  929  699  

www.spryker.com      tech.spryker.com  

github.com/spryker    

34  2016  Spryker  Systems  GmbH  /  code.talks  commerce  2016