SlideShare uma empresa Scribd logo
1 de 53
Baixar para ler offline
Just	
  flash	
  fashion	
  or	
  a	
  classic	
  
Who	
  are	
  you?	
  


  Software	
  Developer	
  for	
  18	
  years	
  
      Worked	
  mainly	
  for	
  ISVs	
  
         Reuters,	
  SunGard,	
  Misys	
  
      Worked	
  for	
  a	
  couple	
  of	
  MIS	
  departments	
  
         DTI,	
  Beazley	
  
  Microsoft	
  MVP	
  for	
  C#	
  
      Interested	
  in	
  OO	
  design	
  
      Interested	
  in	
  Agile	
  methodologies	
  and	
  practices	
  
  No	
  smart	
  guys	
  
      Just	
  the	
  guys	
  in	
  this	
  room	
  
                        Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Agenda	
  

 •  here	
  did	
  it	
  all	
  go	
  wrong?	
  
  W
 •  he	
  problem	
  with	
  N-­‐Tier	
  
  T
 •  QRS	
  to	
  the	
  rescue	
  
  C
    •  emo	
  probably	
  here	
  
     D
 •  oing	
  further	
  
  G




                 Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Where	
  did	
  it	
  all	
  go	
  wrong	
  
Why	
  the	
  N-­‐Tier	
  architecture	
  party	
  is	
  over.	
  




                                Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
The	
  Electronic	
  File	
  




          Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
The	
  Data	
  Entry	
  Screen	
  




           Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Brave	
  New	
  World	
  


  No	
  just	
  about	
  paper	
  input	
  any	
  more	
  
  But	
  architecture	
  still	
  reflects	
  that	
  idea	
  
  We	
  need	
  to	
  reflect	
  that	
  landscape	
  




                  Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
The	
  problem	
  of	
  CRUD	
  
Why	
  are	
  we	
  failing?	
  




                                   Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
RTFM	
  




           Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
The	
  Old	
  Software	
  Lifecycle	
  

  Software	
  design	
  began	
  with	
  CRUD	
  
      Data	
  Flow	
  Diagrams	
  
      Process	
  Diagrams	
  
  IT	
  made	
  it	
  all	
  about	
  the	
  data	
  
  But	
  it	
  was	
  really	
  all	
  about	
  the	
  goal	
  
      What	
  was	
  the	
  data	
  used	
  for	
  	
  




                      Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
But	
  what	
  about	
  MI	
  

  Just	
  capturing	
  data	
  to	
  report	
  it	
  
      But	
  what	
  happens	
  if	
  we	
  want	
  to	
  report	
  something	
  
       new?	
  
      The	
  address	
  change	
  problem.	
  
  Rarely	
  the	
  goal	
  
      Reports	
  are	
  part	
  of	
  a	
  process	
  
         What	
  do	
  we	
  do	
  with	
  that	
  report?	
  




                      Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Insidious	
  CRUD	
  

  This	
  might	
  be	
  good	
  for	
  ‘catalogue	
  data’	
  
  But	
  beware…	
  
      If	
  I	
  set	
  state	
  through	
  CRUD	
  how	
  do	
  I	
  know	
  what	
  to	
  
       set?	
  
      The	
  manual…	
  
      Existing	
  Business	
  Process	
  
  If	
  the	
  domain	
  model	
  is	
  the	
  rules	
  
      Don’t	
  make	
  the	
  user	
  the	
  domain	
  model	
  


                      Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Is	
  it	
  appropriate?	
  




          Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
CQRS	
  to	
  the	
  rescue!	
  
Of	
  course	
  there	
  is	
  no	
  silver	
  bullet…	
  




                                 Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Some	
  N-­‐Tier	
  problems	
  




           Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Breaking	
  out	
  commands	
  




          Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Diets	
  can	
  be	
  healthy	
  




           Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Beware	
  Vampires	
  




          Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Handling	
  a	
  Command	
  

  Load	
  everything	
  we	
  need	
  via	
  infrastructure.	
  
     Usually	
  we	
  only	
  have	
  one	
  aggregate	
  from	
  repository.	
  	
  
     	
  May	
  have	
  other	
  stuff	
  such	
  as	
  information	
  from	
  web	
  
      service	
  calls	
  
  Exercise	
  one	
  method	
  on	
  the	
  aggregate	
  root	
  
     This	
  method	
  is	
  here	
  to	
  keep	
  us	
  from	
  bleeding	
  business	
  
      logic	
  into	
  the	
  command	
  handler	
  
     If	
  we	
  need	
  more	
  than	
  one	
  aggregate	
  involved	
  
      we	
  raise	
  an	
  event	
  for	
  other	
  aggregate	
  roots	
  to	
  
      handle	
  
  Persist	
  and	
  clean	
  up	
  via	
  infrastructure	
  
                     Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Query	
  Questions	
  Answered	
  




         Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Data	
  Structures	
  and	
  Objects	
  


  Data	
  Structure	
  
     Has	
  public	
  state	
  but	
  not	
  behavior	
  
  Class	
  
     Has	
  behavior,	
  encapsulates	
  state	
  




                   Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Two-­‐Tier	
  is	
  Enough	
  


 Presentation	
  

    Infrastructure	
  

       DB	
  
           Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Show	
  Us	
  Some	
  Code	
  Then!	
  

  We	
  wander	
  around	
  some	
  demo	
  code	
  
     We	
  will	
  try	
  to	
  show	
  the	
  steps	
  to	
  CQRS	
  
        Though	
  be	
  warned	
  it	
  may	
  get	
  scrappy	
  




                     Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Going	
  Further	
  
Command-­‐Query	
  separation	
  first	
  step	
  on	
  journey	
  of	
  
a	
  thousand	
  miles	
  




                           Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Event	
  Sourcing	
  




          Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Eventual	
  Consistency	
  




         Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
No	
  one	
  will	
  do	
  that!	
  
How	
  to	
  overcome	
  doubts	
  on	
  cost	
  




                             Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
Strategic	
  Design	
  

  Strategic	
  Design	
  
     Core	
  
     Supporting	
  	
  
     Generic	
  




                    Ian	
  Cooper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.codebetter.com	
  
CQRS	
  –	
  Command	
  and	
  Query	
  Responsibility	
  Segregation	
  




                                                      •  oby	
  Henderson	
  
                                                       T
                                                      •  holytshirt	
  
                                                       @
                                                      •  endersont@gmail.com	
  
                                                       h
                                                      •  ttp://holytshirt.blogspot.com	
  
                                                       h
CQRS	
  C#	
  example	
  

  http://github.com/MarkNijhof/Fohjin	
  


  ttp://bit.ly/prognetcqrs	
  
 h
  Mark	
  Nijhof	
  
  http://elegantcode.com/about/mark-­‐nijhof/	
  
Queries	
  –	
  CQS	
  	
  

  Return	
  a	
  result	
  and	
  do	
  not	
  change	
  the	
  
   observable	
  state	
  of	
  the	
  system	
  (are	
  free	
  of	
  
   side	
  effects).	
  -­‐	
  “Bertrand	
  Meyer”	
  

  Asking	
  a	
  question	
  should	
  not	
  change	
  the	
  
   answer.	
  
Queries	
  –	
  CQRS	
  

  Any	
  need	
  for	
  data	
  from	
  the	
  system	
  is	
  a	
  
   reporting	
  need;	
  this	
  includes	
  the	
  various	
  
   application	
  screens	
  which	
  the	
  user	
  uses	
  to	
  
   base	
  his	
  decisions	
  on.	
  –	
  Greg	
  Young	
  

  Showing	
  user	
  information	
  involves	
  no	
  
   business	
  behaviour	
  and	
  is	
  all	
  about	
  opening	
  
   up	
  that	
  data.	
  –	
  Udi	
  Dahan	
  
Before	
  CQRS	
  

CompanyService	
  

void	
  CreateCompany(Company)	
  
Company	
  GetCompany(CompanyId)	
  	
  
List<Company>	
  GetCompaniesWithName(Name)	
  	
  
void	
  EditCompanyDetails(CompanyDetails)	
  
void	
  Delete	
  Company(CompanyId)	
  
Applying	
  CQRS	
  

CompanyWriteService	
  

void	
  CreateCompany(Company)	
  	
  
void	
  EditCompanyDetails(CompanyDetails)	
  
void	
  DeleteCompany(CompanyId)	
  

CompanyReadService	
  

Company	
  GetCompany(CompanyId)	
  	
  
List<Company>	
  GetCompaniesWithName(Name)	
  	
  
Database	
  



                  Data	
  



            Domain	
  Model	
  




                                  Read	
  
Write	
  



                  DTO	
  



             View	
  Model	
  



                  View	
  
Database	
  


                                                     Data	
  
                  Data	
  



            Domain	
  Model	
  




                                                                     Read	
  
Write	
  




                Services	
  



             View	
  Model	
                     View	
  Model	
  


                  View	
                             View	
  
Sync	
  
              Database	
                       Database	
  


                                                 Data	
  
                  Data	
  



            Domain	
  Model	
  




                                                                 Read	
  
Write	
  




                Services	
  



             View	
  Model	
                 View	
  Model	
  


                  View	
                         View	
  
Sync	
  
             Database	
  


               Data	
  




                               Read	
  
           View	
  Model	
  


               View	
  
Store	
  View	
  Model	
  

  Put	
  ViewModel	
  in	
  the	
  database	
  /	
  storage.	
  
  A	
  table	
  for	
  each	
  view	
  or	
  as	
  much	
  as	
  the	
  view	
  
   as	
  possible.	
  
  Very	
  fast	
  with	
  little	
  or	
  no	
  transformation.	
  
  Database	
  can	
  become	
  a	
  cache.	
  
  No	
  need	
  for	
  ORM.	
  
  Cheap.	
  
  Data	
  is	
  stale	
  anyway.	
  
@NeilRobbins	
  
neil@computer.org	
  
Don	
  Box’s	
  4	
  Tenets	
  of	
  SOA	
  

  Boundaries	
  are	
  explicit	
  
  Services	
  are	
  autonomous	
  
  Services	
  share	
  schema	
  and	
  contract,	
  not	
  class	
  
  Service	
  compatibility	
  is	
  determined	
  based	
  on	
  
   policy	
  
The	
  Open	
  Groups	
  Definition	
  of	
  a	
  
Service	
  
  Is	
  a	
  logical	
  representation	
  of	
  a	
  repeatable	
  
   business	
  activity	
  that	
  has	
  a	
  specified	
  outcome	
  
   (e.g.,	
  check	
  customer	
  credit,	
  provide	
  weather	
  
   data,	
  consolidate	
  drilling	
  reports)	
  
  Is	
  self-­‐contained	
  
  May	
  be	
  composed	
  of	
  other	
  services	
  
  Is	
  a	
  “black	
  box”	
  to	
  consumers	
  of	
  the	
  service	
  

                                                                            	
  
              From:	
  http://www.opengroup.org/soa/source-­‐book/soa/soa.htm
Some	
  Visions	
  of	
  SOA	
  
             “Implementing	
  SOA	
  the	
  right	
  way	
  
             The	
  figure	
  below	
  depicts	
  a	
  well-­‐designed	
  SOA.”	
  

                                                                                     IMO	
  –	
  A	
  Vendors	
  
                                                                                       wet-­‐dream	
  




                                                                                    All	
  in	
  terms	
  of	
  
                                                                               infrastructure,	
  none	
  in	
  
                                                                                 terms	
  of	
  business!	
  




From:	
  http://www.javaworld.com/javaworld/jw-­‐11-­‐2006/jw-­‐1129-­‐soa.html?page=3	
  
Some	
  Visions	
  of	
  SOA	
  




   From:	
  http://www.ibm.com/developerworks/webservices/library/ws-­‐WSBFoverviewpart1/index.html	
  
Some	
  Visions	
  of	
  SOA	
  




                     From:	
  http://www.infoq.com/articles/SOA-­‐enterprise-­‐data	
  
A	
  Vision	
  of	
  SOA	
  

            Composite	
  UI	
  
A	
  Vision	
  of	
  SOA	
  
                                                                            Shopping	
  
                                                                           Cart	
  Service	
  


                             Command	
  
                                                                               Command	
  
                                  Ratings	
  Service	
  
                                                                               Command	
  
                 Product	
                                                     Command	
  
              Images	
  Service	
  

                                                                               Command	
  
                                        Command	
  
            Command	
                                                  Buying	
  Choices	
  
                                                                          Service	
  

                                           Bought	
  Together	
     Offers	
  Service	
  
                                               Service	
  
A	
  Vision	
  of	
  SOA	
  

     Composite	
  UI	
  (also	
  a	
  service)	
  


Shopping	
                                  Bought	
      Product	
  
               Ratings	
     Offers	
  
  Cart	
                                   Together	
     Images	
  
               Service	
     Service	
  
 Service	
                                  Service	
     Service	
  
Not	
  just	
  aligned	
  with	
  Business	
  
Activity	
  	
  
  So	
  each	
  service	
  has	
  its	
  own	
  requirements	
  
  Not	
  just	
  the	
  ‘strictly’	
  functional	
  
  So	
  what	
  might	
  we	
  consider	
  
Yield	
  

  AKA	
  Availability	
  
  A	
  measure	
  of	
  the	
  probability	
  of	
  completing	
  a	
  
   request	
  
     Typically	
  measured	
  in	
  9s	
  (eg	
  0.9999)	
  
  A	
  very	
  common	
  measure	
  in	
  SLAs	
  
Harvest	
  

Mais conteúdo relacionado

Semelhante a Why Cqrs

AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...
AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...
AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...Amazon Web Services
 
Empowering businesses with serverless
Empowering businesses with serverlessEmpowering businesses with serverless
Empowering businesses with serverlessYan Cui
 
Writing Code for Humans, not Computers
Writing Code for Humans, not ComputersWriting Code for Humans, not Computers
Writing Code for Humans, not ComputersRené Cacheaux
 
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise ApplicationsDaniel Oh
 
Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...
Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...
Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...Burr Sutter
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as CodePrasant Kumar
 
Operations: The Last Mile Problem For DevOps
Operations: The Last Mile Problem For DevOpsOperations: The Last Mile Problem For DevOps
Operations: The Last Mile Problem For DevOpsRundeck
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkJoseph Yoder
 
Splunk @ Amazon Startup - Austin, TX - 9/11/2008
Splunk @ Amazon Startup - Austin, TX - 9/11/2008Splunk @ Amazon Startup - Austin, TX - 9/11/2008
Splunk @ Amazon Startup - Austin, TX - 9/11/2008Michael Wilde
 
Modern Operations: Solving DevOps’ Last Mile Problem
Modern Operations: Solving DevOps’ Last Mile Problem Modern Operations: Solving DevOps’ Last Mile Problem
Modern Operations: Solving DevOps’ Last Mile Problem Rundeck
 
The hardcore stuff i hack, experiences from past VAPT assignments
The hardcore stuff i hack, experiences from past VAPT assignmentsThe hardcore stuff i hack, experiences from past VAPT assignments
The hardcore stuff i hack, experiences from past VAPT assignmentsn|u - The Open Security Community
 
Making the Web Fireproof: A Building Code for Websites
Making the Web Fireproof: A Building Code for WebsitesMaking the Web Fireproof: A Building Code for Websites
Making the Web Fireproof: A Building Code for WebsitesDylan Wilbanks
 
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureThomas Jaskula
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnelukdpe
 
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Intel® Software
 
Phiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giới
Phiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giớiPhiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giới
Phiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giớiVietnam Open Infrastructure User Group
 
Before and after hitting the publish button
Before and after hitting the publish buttonBefore and after hitting the publish button
Before and after hitting the publish buttonAlbert De Nova Santana
 

Semelhante a Why Cqrs (20)

The Rise of Mobility
The Rise of MobilityThe Rise of Mobility
The Rise of Mobility
 
AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...
AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...
AWS re:Invent 2016: Transforming Industrial Processes with Deep Learning (MAC...
 
Empowering businesses with serverless
Empowering businesses with serverlessEmpowering businesses with serverless
Empowering businesses with serverless
 
Pebble Tech Talk 2012
Pebble Tech Talk 2012Pebble Tech Talk 2012
Pebble Tech Talk 2012
 
Writing Code for Humans, not Computers
Writing Code for Humans, not ComputersWriting Code for Humans, not Computers
Writing Code for Humans, not Computers
 
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
 
Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...
Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...
Teaching Elephants to Dance (and Fly!) A Developer's Journey to Digital Trans...
 
NDepend
NDependNDepend
NDepend
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Operations: The Last Mile Problem For DevOps
Operations: The Last Mile Problem For DevOpsOperations: The Last Mile Problem For DevOps
Operations: The Last Mile Problem For DevOps
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
 
Splunk @ Amazon Startup - Austin, TX - 9/11/2008
Splunk @ Amazon Startup - Austin, TX - 9/11/2008Splunk @ Amazon Startup - Austin, TX - 9/11/2008
Splunk @ Amazon Startup - Austin, TX - 9/11/2008
 
Modern Operations: Solving DevOps’ Last Mile Problem
Modern Operations: Solving DevOps’ Last Mile Problem Modern Operations: Solving DevOps’ Last Mile Problem
Modern Operations: Solving DevOps’ Last Mile Problem
 
The hardcore stuff i hack, experiences from past VAPT assignments
The hardcore stuff i hack, experiences from past VAPT assignmentsThe hardcore stuff i hack, experiences from past VAPT assignments
The hardcore stuff i hack, experiences from past VAPT assignments
 
Making the Web Fireproof: A Building Code for Websites
Making the Web Fireproof: A Building Code for WebsitesMaking the Web Fireproof: A Building Code for Websites
Making the Web Fireproof: A Building Code for Websites
 
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architecture
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnel
 
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
 
Phiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giới
Phiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giớiPhiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giới
Phiên sáng - 05 - Chia sẻ về Open Infrastructure trên thế giới
 
Before and after hitting the publish button
Before and after hitting the publish buttonBefore and after hitting the publish button
Before and after hitting the publish button
 

Mais de Skills Matter

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard LawrenceSkills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimSkills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsSkills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingSkills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveSkills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tSkills Matter
 

Mais de Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 

Último

Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 

Why Cqrs

  • 1. Just  flash  fashion  or  a  classic  
  • 2. Who  are  you?     Software  Developer  for  18  years     Worked  mainly  for  ISVs     Reuters,  SunGard,  Misys     Worked  for  a  couple  of  MIS  departments     DTI,  Beazley     Microsoft  MVP  for  C#     Interested  in  OO  design     Interested  in  Agile  methodologies  and  practices     No  smart  guys     Just  the  guys  in  this  room   Ian  Cooper                                                                                                                www.codebetter.com  
  • 3. Agenda   •  here  did  it  all  go  wrong?   W •  he  problem  with  N-­‐Tier   T •  QRS  to  the  rescue   C •  emo  probably  here   D •  oing  further   G Ian  Cooper                                                                                                                www.codebetter.com  
  • 4. Where  did  it  all  go  wrong   Why  the  N-­‐Tier  architecture  party  is  over.   Ian  Cooper                                                                                                                www.codebetter.com  
  • 5. The  Electronic  File   Ian  Cooper                                                                                                                www.codebetter.com  
  • 6. The  Data  Entry  Screen   Ian  Cooper                                                                                                                www.codebetter.com  
  • 7. Brave  New  World     No  just  about  paper  input  any  more     But  architecture  still  reflects  that  idea     We  need  to  reflect  that  landscape   Ian  Cooper                                                                                                                www.codebetter.com  
  • 8. The  problem  of  CRUD   Why  are  we  failing?   Ian  Cooper                                                                                                                www.codebetter.com  
  • 9. RTFM   Ian  Cooper                                                                                                                www.codebetter.com  
  • 10. The  Old  Software  Lifecycle     Software  design  began  with  CRUD     Data  Flow  Diagrams     Process  Diagrams     IT  made  it  all  about  the  data     But  it  was  really  all  about  the  goal     What  was  the  data  used  for     Ian  Cooper                                                                                                                www.codebetter.com  
  • 11. But  what  about  MI     Just  capturing  data  to  report  it     But  what  happens  if  we  want  to  report  something   new?     The  address  change  problem.     Rarely  the  goal     Reports  are  part  of  a  process     What  do  we  do  with  that  report?   Ian  Cooper                                                                                                                www.codebetter.com  
  • 12. Insidious  CRUD     This  might  be  good  for  ‘catalogue  data’     But  beware…     If  I  set  state  through  CRUD  how  do  I  know  what  to   set?     The  manual…     Existing  Business  Process     If  the  domain  model  is  the  rules     Don’t  make  the  user  the  domain  model   Ian  Cooper                                                                                                                www.codebetter.com  
  • 13. Is  it  appropriate?   Ian  Cooper                                                                                                                www.codebetter.com  
  • 14. CQRS  to  the  rescue!   Of  course  there  is  no  silver  bullet…   Ian  Cooper                                                                                                                www.codebetter.com  
  • 15. Some  N-­‐Tier  problems   Ian  Cooper                                                                                                                www.codebetter.com  
  • 16. Breaking  out  commands   Ian  Cooper                                                                                                                www.codebetter.com  
  • 17. Diets  can  be  healthy   Ian  Cooper                                                                                                                www.codebetter.com  
  • 18. Beware  Vampires   Ian  Cooper                                                                                                                www.codebetter.com  
  • 19. Handling  a  Command     Load  everything  we  need  via  infrastructure.     Usually  we  only  have  one  aggregate  from  repository.        May  have  other  stuff  such  as  information  from  web   service  calls     Exercise  one  method  on  the  aggregate  root     This  method  is  here  to  keep  us  from  bleeding  business   logic  into  the  command  handler     If  we  need  more  than  one  aggregate  involved   we  raise  an  event  for  other  aggregate  roots  to   handle     Persist  and  clean  up  via  infrastructure   Ian  Cooper                                                                                                                www.codebetter.com  
  • 20. Query  Questions  Answered   Ian  Cooper                                                                                                                www.codebetter.com  
  • 21. Data  Structures  and  Objects     Data  Structure     Has  public  state  but  not  behavior     Class     Has  behavior,  encapsulates  state   Ian  Cooper                                                                                                                www.codebetter.com  
  • 22. Two-­‐Tier  is  Enough   Presentation   Infrastructure   DB   Ian  Cooper                                                                                                                www.codebetter.com  
  • 23. Show  Us  Some  Code  Then!     We  wander  around  some  demo  code     We  will  try  to  show  the  steps  to  CQRS     Though  be  warned  it  may  get  scrappy   Ian  Cooper                                                                                                                www.codebetter.com  
  • 24. Going  Further   Command-­‐Query  separation  first  step  on  journey  of   a  thousand  miles   Ian  Cooper                                                                                                                www.codebetter.com  
  • 25. Event  Sourcing   Ian  Cooper                                                                                                                www.codebetter.com  
  • 26. Ian  Cooper                                                                                                                www.codebetter.com  
  • 27. Eventual  Consistency   Ian  Cooper                                                                                                                www.codebetter.com  
  • 28. No  one  will  do  that!   How  to  overcome  doubts  on  cost   Ian  Cooper                                                                                                                www.codebetter.com  
  • 29. Strategic  Design     Strategic  Design     Core     Supporting       Generic   Ian  Cooper                                                                                                                www.codebetter.com  
  • 30. CQRS  –  Command  and  Query  Responsibility  Segregation   •  oby  Henderson   T •  holytshirt   @ •  endersont@gmail.com   h •  ttp://holytshirt.blogspot.com   h
  • 31. CQRS  C#  example     http://github.com/MarkNijhof/Fohjin     ttp://bit.ly/prognetcqrs   h   Mark  Nijhof     http://elegantcode.com/about/mark-­‐nijhof/  
  • 32. Queries  –  CQS       Return  a  result  and  do  not  change  the   observable  state  of  the  system  (are  free  of   side  effects).  -­‐  “Bertrand  Meyer”     Asking  a  question  should  not  change  the   answer.  
  • 33. Queries  –  CQRS     Any  need  for  data  from  the  system  is  a   reporting  need;  this  includes  the  various   application  screens  which  the  user  uses  to   base  his  decisions  on.  –  Greg  Young     Showing  user  information  involves  no   business  behaviour  and  is  all  about  opening   up  that  data.  –  Udi  Dahan  
  • 34. Before  CQRS   CompanyService   void  CreateCompany(Company)   Company  GetCompany(CompanyId)     List<Company>  GetCompaniesWithName(Name)     void  EditCompanyDetails(CompanyDetails)   void  Delete  Company(CompanyId)  
  • 35. Applying  CQRS   CompanyWriteService   void  CreateCompany(Company)     void  EditCompanyDetails(CompanyDetails)   void  DeleteCompany(CompanyId)   CompanyReadService   Company  GetCompany(CompanyId)     List<Company>  GetCompaniesWithName(Name)    
  • 36. Database   Data   Domain  Model   Read   Write   DTO   View  Model   View  
  • 37. Database   Data   Data   Domain  Model   Read   Write   Services   View  Model   View  Model   View   View  
  • 38. Sync   Database   Database   Data   Data   Domain  Model   Read   Write   Services   View  Model   View  Model   View   View  
  • 39. Sync   Database   Data   Read   View  Model   View  
  • 40. Store  View  Model     Put  ViewModel  in  the  database  /  storage.     A  table  for  each  view  or  as  much  as  the  view   as  possible.     Very  fast  with  little  or  no  transformation.     Database  can  become  a  cache.     No  need  for  ORM.     Cheap.     Data  is  stale  anyway.  
  • 41.
  • 43. Don  Box’s  4  Tenets  of  SOA     Boundaries  are  explicit     Services  are  autonomous     Services  share  schema  and  contract,  not  class     Service  compatibility  is  determined  based  on   policy  
  • 44. The  Open  Groups  Definition  of  a   Service     Is  a  logical  representation  of  a  repeatable   business  activity  that  has  a  specified  outcome   (e.g.,  check  customer  credit,  provide  weather   data,  consolidate  drilling  reports)     Is  self-­‐contained     May  be  composed  of  other  services     Is  a  “black  box”  to  consumers  of  the  service     From:  http://www.opengroup.org/soa/source-­‐book/soa/soa.htm
  • 45. Some  Visions  of  SOA   “Implementing  SOA  the  right  way   The  figure  below  depicts  a  well-­‐designed  SOA.”   IMO  –  A  Vendors   wet-­‐dream   All  in  terms  of   infrastructure,  none  in   terms  of  business!   From:  http://www.javaworld.com/javaworld/jw-­‐11-­‐2006/jw-­‐1129-­‐soa.html?page=3  
  • 46. Some  Visions  of  SOA   From:  http://www.ibm.com/developerworks/webservices/library/ws-­‐WSBFoverviewpart1/index.html  
  • 47. Some  Visions  of  SOA   From:  http://www.infoq.com/articles/SOA-­‐enterprise-­‐data  
  • 48. A  Vision  of  SOA   Composite  UI  
  • 49. A  Vision  of  SOA   Shopping   Cart  Service   Command   Command   Ratings  Service   Command   Product   Command   Images  Service   Command   Command   Command   Buying  Choices   Service   Bought  Together   Offers  Service   Service  
  • 50. A  Vision  of  SOA   Composite  UI  (also  a  service)   Shopping   Bought   Product   Ratings   Offers   Cart   Together   Images   Service   Service   Service   Service   Service  
  • 51. Not  just  aligned  with  Business   Activity       So  each  service  has  its  own  requirements     Not  just  the  ‘strictly’  functional     So  what  might  we  consider  
  • 52. Yield     AKA  Availability     A  measure  of  the  probability  of  completing  a   request     Typically  measured  in  9s  (eg  0.9999)     A  very  common  measure  in  SLAs