SlideShare a Scribd company logo
*
 Forum
 PHP
 Paris
 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.

 Podcaster, User Group
        Leader.

Developer at WEBclusive.
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
Annotating with Annotations - ForumPHP 2012
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
Annotating with Annotations - ForumPHP 2012
No
 core
 
annotation
 support
Questions?
Questions?

I’m
 kidding!
Annotating with Annotations - ForumPHP 2012
Annotating with Annotations - ForumPHP 2012
phpDoc
~2000
PHP
 5.1
  Reflection
 supports
 
   getDocComments()



phpDoc
~2000                              2005
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()



phpDoc
~2000                                                                         2005



                                      First
 
                                   Annotation
 Engines
 in
 PHP
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()



phpDoc
~2000                                                                         2005                                   2008



                                      First
 
                                   Annotation

More Related Content

PDF
Annotations in PHP - ConFoo 2013
KEY
Annotating with Annotations
PDF
Annotating with Annotations - PHPBenelux June/2012
PDF
Annotations in PHP, They Exist.
PPTX
Real world DSL - making technical and business people speaking the same language
PDF
Undergrad Interfaces Lecture 2008
PDF
Fudcon D programming
PDF
Rascal Devnology Code Fest
Annotations in PHP - ConFoo 2013
Annotating with Annotations
Annotating with Annotations - PHPBenelux June/2012
Annotations in PHP, They Exist.
Real world DSL - making technical and business people speaking the same language
Undergrad Interfaces Lecture 2008
Fudcon D programming
Rascal Devnology Code Fest

Similar to Annotating with Annotations - ForumPHP 2012 (20)

PDF
Annotating with Annotations - DPC UnCon
PDF
Annotations in PHP: They Exist
PDF
PHP Annotations: They exist! - JetBrains Webinar
PDF
An Architecture for Open Cross-Media Annotation Services
PDF
Overcoming The Impedance Mismatch Between Source Code And Architecture
PDF
Ow2 Utilities - The Swiss Army Knife Of Ow2 Projects
PPTX
Spl in the wild - zendcon2012
PDF
PDF
Model-Driven Software Development - Language Workbenches & Syntax Definition
PDF
Postgres demystified
PDF
Harnessing Stack Overflow for the IDE - RSSE 2012
PDF
Code Generation
PPTX
PDF
VA Smalltalk Update
PPTX
Univ of va intentional introduction 2013 01-31
PPTX
Type-safe DSLs
PDF
The Dynamic Language is not Enough
PDF
Demo Caspar Web Desktop Luigi Briguglio
PDF
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
PDF
Trends and future of C++: Evolving a systems language for performance - by Bj...
Annotating with Annotations - DPC UnCon
Annotations in PHP: They Exist
PHP Annotations: They exist! - JetBrains Webinar
An Architecture for Open Cross-Media Annotation Services
Overcoming The Impedance Mismatch Between Source Code And Architecture
Ow2 Utilities - The Swiss Army Knife Of Ow2 Projects
Spl in the wild - zendcon2012
Model-Driven Software Development - Language Workbenches & Syntax Definition
Postgres demystified
Harnessing Stack Overflow for the IDE - RSSE 2012
Code Generation
VA Smalltalk Update
Univ of va intentional introduction 2013 01-31
Type-safe DSLs
The Dynamic Language is not Enough
Demo Caspar Web Desktop Luigi Briguglio
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
Trends and future of C++: Evolving a systems language for performance - by Bj...
Ad

More from Rafael Dohms (20)

PDF
The Individual Contributor Path - DPC2024
PDF
Application Metrics - IPC2023
PDF
How'd we get here? A guide to Architectural Decision Records
PDF
Architectural Decision Records - PHPConfBR
PDF
Application Metrics (with Prometheus examples)
PDF
Application metrics - Confoo 2019
PDF
Writing code you won’t hate tomorrow - PHPCE18
PDF
Application Metrics (with Prometheus examples) #PHPDD18
PDF
Application metrics with Prometheus - DPC18
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
PDF
Composer The Right Way - 010PHP
PDF
Writing Code That Lasts - #Magento2Seminar, Utrecht
PDF
Composer the Right Way - PHPSRB16
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
PDF
Composer the Right Way - MM16NL
PDF
Composer The Right Way - PHPUGMRN
PDF
Composer the Right Way - PHPBNL16
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow.
PDF
A Journey into your Lizard Brain - PHP Conference Brasil 2015
The Individual Contributor Path - DPC2024
Application Metrics - IPC2023
How'd we get here? A guide to Architectural Decision Records
Architectural Decision Records - PHPConfBR
Application Metrics (with Prometheus examples)
Application metrics - Confoo 2019
Writing code you won’t hate tomorrow - PHPCE18
Application Metrics (with Prometheus examples) #PHPDD18
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. - PHP Yo...
Composer The Right Way - 010PHP
Writing Code That Lasts - #Magento2Seminar, Utrecht
Composer the Right Way - PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
Composer the Right Way - MM16NL
Composer The Right Way - PHPUGMRN
Composer the Right Way - PHPBNL16
“Writing code that lasts” … or writing code you won’t hate tomorrow.
A Journey into your Lizard Brain - PHP Conference Brasil 2015
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Machine Learning_overview_presentation.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Weekly Chronicles - August'25-Week II
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine Learning_overview_presentation.pptx
Assigned Numbers - 2025 - Bluetooth® Document

Annotating with Annotations - ForumPHP 2012