SlideShare a Scribd company logo
1 of 117
*
 TrueNorthPHP
 -
 Toronto/2012




 Annotating
 with
 
   Annotations
         A
 look
 into
 Annotations
 in
 PHP



                                                                                                                                   on
 twitter                                 Rafael
 Dohms
                                                                                                                                                                                                                        @rdohms
*
 TrueNorthPHP
 -
 Toronto/2012




 Annotating
 with
 
   Annotations
         A
 look
 into
 Annotations
 in
 PHP



                                                                                                                                   on
 twitter                                 Rafael
 Dohms
                                                                                                                                                                                                                        @rdohms
Rafael Dohms




                           photo credit: Eli White
       @rdohms


 Evangelist, Speaker and
      Contributor.

Developer at WEBclusive.

Enabler at AmsterdamPHP.
a
 little
 history                                                                                                                                                 existing
 uses



                                                                                     What?                                  Why?                                                            Where?




                                                                                                                          How?
                                                                                                                                     ustom
 ann otations
                                                                                     Impl ementing
 c DMSFilter
                                                                                             based
 on
 

                                                                                                                                       show
 me
 the
 code!
http://ecdesignrebels.blogspot.com




   w h a t?                                                                           ta tio ns?
                                            re
 an no
W ha t
 a
-- In English --
An annotation is a note that is made
  while reading any form of text.
something
 that
 describes
 an
 aspect
 of
 the
 subject



          -- In English --
An annotation is a note that is made
  while reading any form of text.
-- In Code Speak --


“An annotation describes behavior of
 code and affects your application in
              runtime.”


 “Annotations do not directly affect
       program semantics”
-- In Code Speak --


“An annotation describes behavior of
 code and affects your application in
              runtime.”


 “Annotations do not directly affect
       program semantics”
         just
 like
 your
 notes
In
 2004:
 Metadata
 or
 
“General
 purpose
 Annotations”
In
 2004:
 Metadata
 or
 
“General
 purpose
 Annotations”




                                                                       available
 at
 Runtime
 using
 Reflection
In
 2004:
 Metadata
 or
 
“General
 purpose
 Annotations”

                    @Entity
                      @Table(name = people)
                      class Person implements Serializable {
                        @Id
                        @GeneratedValue(strategy = GenerationType.AUTO)
                        private Integer id;

                                    @Column(length = 32)
                                    private String name;




                                                                       available
 at
 Runtime
 using
 Reflection
In
 2004:
 Metadata
 or
 
“General
 purpose
 Annotations”
                                                                                                                                                                    specific
 syntax
                    @Entity
                      @Table(name = people)
                      class Person implements Serializable {
                        @Id
                        @GeneratedValue(strategy = GenerationType.AUTO)
                        private Integer id;

                                    @Column(length = 32)
                                    private String name;




                                                                       available
 at
 Runtime
 using
 Reflection
No
 core
 
annotation
 support
Questions?
Questions?

I’m
 kidding!
phpDoc
~2000
PHP
 5.1
  Reflection
 supports
 
   getDocComments()



phpDoc
~2000                              2005
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()



phpDoc
~2000                                                                         2005



                                      First
 
                                   Annotation

More Related Content

What's hot

Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Ahmed Gad
 
Fundamentalsofprogrammingfinal 121011003536-phpapp02
Fundamentalsofprogrammingfinal 121011003536-phpapp02Fundamentalsofprogrammingfinal 121011003536-phpapp02
Fundamentalsofprogrammingfinal 121011003536-phpapp02
thinesonsing
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
Ahmed Gad
 
OOPSLA02 BehavioralSemantics.ppt
OOPSLA02 BehavioralSemantics.pptOOPSLA02 BehavioralSemantics.ppt
OOPSLA02 BehavioralSemantics.ppt
Ptidej Team
 

What's hot (14)

A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
 
C++0x :: Introduction to some amazing features
C++0x :: Introduction to some amazing featuresC++0x :: Introduction to some amazing features
C++0x :: Introduction to some amazing features
 
About python
About pythonAbout python
About python
 
Intr fortran90
Intr fortran90Intr fortran90
Intr fortran90
 
Fundamentalsofprogrammingfinal 121011003536-phpapp02
Fundamentalsofprogrammingfinal 121011003536-phpapp02Fundamentalsofprogrammingfinal 121011003536-phpapp02
Fundamentalsofprogrammingfinal 121011003536-phpapp02
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
OOPSLA02 BehavioralSemantics.ppt
OOPSLA02 BehavioralSemantics.pptOOPSLA02 BehavioralSemantics.ppt
OOPSLA02 BehavioralSemantics.ppt
 
ASE01.ppt
ASE01.pptASE01.ppt
ASE01.ppt
 
Python basics
Python basicsPython basics
Python basics
 

Similar to Annotating with Annotations

Os Worthington
Os WorthingtonOs Worthington
Os Worthington
oscon2007
 

Similar to Annotating with Annotations (20)

Annotations in PHP - ConFoo 2013
Annotations in PHP - ConFoo 2013Annotations in PHP - ConFoo 2013
Annotations in PHP - ConFoo 2013
 
Annotations in PHP: They Exist
Annotations in PHP: They ExistAnnotations in PHP: They Exist
Annotations in PHP: They Exist
 
Annotations in PHP, They Exist.
Annotations in PHP, They Exist.Annotations in PHP, They Exist.
Annotations in PHP, They Exist.
 
PHP Annotations: They exist! - JetBrains Webinar
 PHP Annotations: They exist! - JetBrains Webinar PHP Annotations: They exist! - JetBrains Webinar
PHP Annotations: They exist! - JetBrains Webinar
 
Overview of php
Overview of phpOverview of php
Overview of php
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
 
Chap1introppt1php basic
Chap1introppt1php basicChap1introppt1php basic
Chap1introppt1php basic
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
 
T4 presentation
T4 presentationT4 presentation
T4 presentation
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
 
GATE : General Architecture for Text Engineering
GATE : General Architecture for Text EngineeringGATE : General Architecture for Text Engineering
GATE : General Architecture for Text Engineering
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
 
Php training100%placement-in-mumbai
Php training100%placement-in-mumbaiPhp training100%placement-in-mumbai
Php training100%placement-in-mumbai
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Introduction to-php
Introduction to-phpIntroduction to-php
Introduction to-php
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHP
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 

More from Rafael Dohms

More from Rafael Dohms (20)

The Individual Contributor Path - DPC2024
The Individual Contributor Path - DPC2024The Individual Contributor Path - DPC2024
The Individual Contributor Path - DPC2024
 
Application Metrics - IPC2023
Application Metrics - IPC2023Application Metrics - IPC2023
Application Metrics - IPC2023
 
How'd we get here? A guide to Architectural Decision Records
How'd we get here? A guide to Architectural Decision RecordsHow'd we get here? A guide to Architectural Decision Records
How'd we get here? A guide to Architectural Decision Records
 
Architectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBRArchitectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBR
 
Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)
 
Application metrics - Confoo 2019
Application metrics - Confoo 2019Application metrics - Confoo 2019
Application metrics - Confoo 2019
 
Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18
 
Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18
 
Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
 
Composer The Right Way - 010PHP
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHP
 
Writing Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, UtrechtWriting Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, Utrecht
 
Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
Composer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRNComposer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRN
 
Composer the Right Way - PHPBNL16
Composer the Right Way - PHPBNL16Composer the Right Way - PHPBNL16
Composer the Right Way - PHPBNL16
 
“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
 
A Journey into your Lizard Brain - PHP Conference Brasil 2015
A Journey into your Lizard Brain - PHP Conference Brasil 2015A Journey into your Lizard Brain - PHP Conference Brasil 2015
A Journey into your Lizard Brain - PHP Conference Brasil 2015
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Annotating with Annotations

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. Overview of how annotations are just descriptions of static resources. Like HTML syntax can describe text with bold, italic\n
  7. Overview of how annotations are just descriptions of static resources. Like HTML syntax can describe text with bold, italic\n
  8. phpDoc vs. Annotation: docs do not have influence in how a app runs.\nAnnotation by itself does not “act” its used to be acted on by another class.\n\nJust putting an annotation is not going to work, you need someone to act on it.\n
  9. phpDoc vs. Annotation: docs do not have influence in how a app runs.\nAnnotation by itself does not “act” its used to be acted on by another class.\n\nJust putting an annotation is not going to work, you need someone to act on it.\n
  10. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  11. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  12. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  13. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  14. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  15. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  16. Java: annotations since 2004, same syntax for javadocs and annotations\nRuntime uses reflection to read annnotations\nJavadoc Vs. Annotations: same as PHPDoc mentioned before\n
  17. PHP has no support for Annotations.\n
  18. PHP has no support for Annotations.\n
  19. Pretend its the end of the talk.\n
  20. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  21. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  22. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  23. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  24. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  25. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  26. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  27. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  28. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  29. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  30. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  31. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  32. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  33. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  34. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  35. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  36. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  37. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  38. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  39. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  40. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  41. Mentions stubbles and other engines.\nTie in D2 Annotation Engine and Gulherme as the author of both.\n
  42. Make a note that PHP does have a custom token for DOCBLOCKS so annotations are not in “documents” and docblocks are even stored in opcode caches.\n
  43. Make a note that PHP does have a custom token for DOCBLOCKS so annotations are not in “documents” and docblocks are even stored in opcode caches.\n
  44. Make a note that PHP does have a custom token for DOCBLOCKS so annotations are not in “documents” and docblocks are even stored in opcode caches.\n
  45. Make a note that PHP does have a custom token for DOCBLOCKS so annotations are not in “documents” and docblocks are even stored in opcode caches.\n
  46. Make a note that PHP does have a custom token for DOCBLOCKS so annotations are not in “documents” and docblocks are even stored in opcode caches.\n
  47. Diferentiate between Marker Type and Parametrized type\n\nParameterized has more details and complex syntax , marker has no content or simple string syntax\n
  48. Diferentiate between Marker Type and Parametrized type\n\nParameterized has more details and complex syntax , marker has no content or simple string syntax\n
  49. Diferentiate between Marker Type and Parametrized type\n\nParameterized has more details and complex syntax , marker has no content or simple string syntax\n
  50. Diferentiate between Marker Type and Parametrized type\n\nParameterized has more details and complex syntax , marker has no content or simple string syntax\n
  51. \n
  52. T_DOC_COMMENTS since PHP 5.3 - APC support\n\nDebugging is harder but really a problem.\nPerformance is much better with cache\n\nTesting: can be done by feeding annotation “action” service with populated entities for example\n
  53. T_DOC_COMMENTS since PHP 5.3 - APC support\n\nDebugging is harder but really a problem.\nPerformance is much better with cache\n\nTesting: can be done by feeding annotation “action” service with populated entities for example\n
  54. T_DOC_COMMENTS since PHP 5.3 - APC support\n\nDebugging is harder but really a problem.\nPerformance is much better with cache\n\nTesting: can be done by feeding annotation “action” service with populated entities for example\n
  55. Pros:\n- Compare D1 to D2, you no longer need to extend an object to have persistence behaviour\n- 1 config file with 1000 objects vs. 1000 objects with all their own config\n
  56. Pros:\n- Compare D1 to D2, you no longer need to extend an object to have persistence behaviour\n- 1 config file with 1000 objects vs. 1000 objects with all their own config\n
  57. Pros:\n- Compare D1 to D2, you no longer need to extend an object to have persistence behaviour\n- 1 config file with 1000 objects vs. 1000 objects with all their own config\n
  58. Pros:\n- Compare D1 to D2, you no longer need to extend an object to have persistence behaviour\n- 1 config file with 1000 objects vs. 1000 objects with all their own config\n
  59. Pros:\n- Compare D1 to D2, you no longer need to extend an object to have persistence behaviour\n- 1 config file with 1000 objects vs. 1000 objects with all their own config\n
  60. Pros:\n- Compare D1 to D2, you no longer need to extend an object to have persistence behaviour\n- 1 config file with 1000 objects vs. 1000 objects with all their own config\n
  61. \n
  62. \n
  63. \n
  64. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  65. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  66. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  67. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  68. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  69. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  70. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  71. So imagine you are planning a new entity, your mind usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  72. So imagine you are planning a new entity, your imnd usually puts a post it on it with all this information\nYou would then have to put persistance in one config, validation in another...\n\nNote how all validations rules are now in a single place.\nEasier to maintain, since its easier to analyse all aspects\n
  73. \n
  74. Common uses for annotations in PHP\n\nPersistence, grouping, routing, docs, validation, filtering, expectations, API Generation\n
  75. phpDoc uses just marker annotations which arguably are not annotations\nPHPUnit uses it for a long time\nnew frameworks have their own engines and D2 was Hibernate based.\n
  76. Example from PHPUnit\n
  77. Example from D2\n
  78. Example from SF2\n
  79. Example in Typo3\n
  80. \n
  81. So what do you need to have annotations in you application?\n
  82. So what do you need to have annotations in you application?\n
  83. So what do you need to have annotations in you application?\n
  84. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  85. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  86. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  87. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  88. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  89. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  90. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  91. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  92. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  93. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  94. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  95. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  96. How annotations (text) become actual rules/objects.\nReflection to read, and annotation engine to parse and instantiate.\nNOTE: from here another service will use these annotations to “act” upon the code.\n
  97. Some of the engines out there.\nZF2 has no docs or use yet.\nNotoj by Cesar Rodas is very new\nphpDocumentor has a new engine\nphp-annotations by Rasmus Schultz\n\n\nSome were abandoned along the way\n
  98. No dependencies on any\nNotoj is very “microPHP”\nReming people of parameterized vs. marker\n\nD2 is the best support right now. With caching and the whole load\n
  99. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  100. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  101. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  102. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  103. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  104. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  105. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  106. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  107. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  108. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  109. How the D2 Engine works .. a high overview.\nThe Reader gets the data from the class which is the parsed by the lexer and finally becomes instances. Which are cached and passed in the format of Metadata classes to your walker/action class\n\n
  110. All examples are going to be from DMS\\Filter\n
  111. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  112. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  113. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  114. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  115. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  116. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  117. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  118. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  119. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  120. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  121. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  122. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  123. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  124. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  125. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  126. All you really need is to implement a “Annotation” class and a Enforcer, a class that will be able to get an annotation and know what to do. i.e. call the “filterValue” method with the value from the object and replace the original value with the clean one.\n
  127. Simple Annotation that needs no parameters (made simple on purpose)\nMention that parameters come in an array but we will explain later\nShow method of “action” in this case just a filter, could be any action or data\n
  128. Simple Annotation that needs no parameters (made simple on purpose)\nMention that parameters come in an array but we will explain later\nShow method of “action” in this case just a filter, could be any action or data\n
  129. Simple Annotation that needs no parameters (made simple on purpose)\nMention that parameters come in an array but we will explain later\nShow method of “action” in this case just a filter, could be any action or data\n
  130. Simple Annotation that needs no parameters (made simple on purpose)\nMention that parameters come in an array but we will explain later\nShow method of “action” in this case just a filter, could be any action or data\n
  131. Simple Annotation that needs no parameters (made simple on purpose)\nMention that parameters come in an array but we will explain later\nShow method of “action” in this case just a filter, could be any action or data\n
  132. Simple Annotation that needs no parameters (made simple on purpose)\nMention that parameters come in an array but we will explain later\nShow method of “action” in this case just a filter, could be any action or data\n
  133. Explain this simple “Enforcer” class\nIt only gets a single annotation from the reader\nIt makes the action described by the annotation happen.\n\n
  134. Explain this simple “Enforcer” class\nIt only gets a single annotation from the reader\nIt makes the action described by the annotation happen.\n\n
  135. Explain this simple “Enforcer” class\nIt only gets a single annotation from the reader\nIt makes the action described by the annotation happen.\n\n
  136. Explain this simple “Enforcer” class\nIt only gets a single annotation from the reader\nIt makes the action described by the annotation happen.\n\n
  137. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  138. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  139. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  140. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  141. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  142. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  143. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  144. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  145. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  146. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  147. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  148. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  149. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  150. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  151. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  152. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  153. DMS implements a Loader that loads all annotations and filters for “filter rules” since we have multiple classes\nDMS implements a walker that abstracts away reflection->makeAccessible and knows where to fin annotations (method/properties/etc..)\nFilter becomes a simple service that delegates actions.\n
  154. the key is assumed to be the “defaultProperty”\n
  155. the key is assumed to be the “defaultProperty”\n
  156. the key is assumed to be the “defaultProperty”\n
  157. the key is assumed to be the “defaultProperty”\n
  158. the key is assumed to be the “defaultProperty”\n
  159. the key is assumed to be the “defaultProperty”\n
  160. the key is assumed to be the “defaultProperty”\n
  161. the key is assumed to be the “defaultProperty”\n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n