Annotating with Annotations - ForumPHP 2012

Rafael Dohms
Rafael DohmsLead Backend Engineer at Usabilla
*
 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
1 of 113

Recommended

Annotations in PHP - ConFoo 2013 by
Annotations in PHP - ConFoo 2013Annotations in PHP - ConFoo 2013
Annotations in PHP - ConFoo 2013Rafael Dohms
5.9K views138 slides
Annotating with Annotations by
Annotating with AnnotationsAnnotating with Annotations
Annotating with AnnotationsRafael Dohms
11K views117 slides
Annotating with Annotations - PHPBenelux June/2012 by
Annotating with Annotations - PHPBenelux June/2012Annotating with Annotations - PHPBenelux June/2012
Annotating with Annotations - PHPBenelux June/2012Rafael Dohms
1.2K views117 slides
Annotations in PHP, They Exist. by
Annotations in PHP, They Exist.Annotations in PHP, They Exist.
Annotations in PHP, They Exist.Rafael Dohms
5.1K views154 slides
Real world DSL - making technical and business people speaking the same language by
Real world DSL - making technical and business people speaking the same languageReal world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same languageMario Fusco
10.8K views26 slides
Undergrad Interfaces Lecture 2008 by
Undergrad Interfaces Lecture 2008Undergrad Interfaces Lecture 2008
Undergrad Interfaces Lecture 2008Stacy Branham
264 views22 slides

More Related Content

Similar to Annotating with Annotations - ForumPHP 2012

Annotating with Annotations - DPC UnCon by
Annotating with Annotations - DPC UnConAnnotating with Annotations - DPC UnCon
Annotating with Annotations - DPC UnConRafael Dohms
2K views114 slides
Annotations in PHP: They Exist by
Annotations in PHP: They ExistAnnotations in PHP: They Exist
Annotations in PHP: They ExistRafael Dohms
207.1K views138 slides
Write code that writes code! by
Write code that writes code!Write code that writes code!
Write code that writes code!Jason Feinstein
110 views96 slides
Write code that writes code! A beginner's guide to Annotation Processing - Ja... by
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...DroidConTLV
531 views96 slides
PHP Annotations: They exist! - JetBrains Webinar by
 PHP Annotations: They exist! - JetBrains Webinar PHP Annotations: They exist! - JetBrains Webinar
PHP Annotations: They exist! - JetBrains WebinarRafael Dohms
39.5K views140 slides
Pharo: A Reflective System by
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective SystemPharo
1.4K views37 slides

Similar to Annotating with Annotations - ForumPHP 2012(20)

Annotating with Annotations - DPC UnCon by Rafael Dohms
Annotating with Annotations - DPC UnConAnnotating with Annotations - DPC UnCon
Annotating with Annotations - DPC UnCon
Rafael Dohms2K views
Annotations in PHP: They Exist by Rafael Dohms
Annotations in PHP: They ExistAnnotations in PHP: They Exist
Annotations in PHP: They Exist
Rafael Dohms207.1K views
Write code that writes code! A beginner's guide to Annotation Processing - Ja... by DroidConTLV
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...
DroidConTLV531 views
PHP Annotations: They exist! - JetBrains Webinar by Rafael Dohms
 PHP Annotations: They exist! - JetBrains Webinar PHP Annotations: They exist! - JetBrains Webinar
PHP Annotations: They exist! - JetBrains Webinar
Rafael Dohms39.5K views
Pharo: A Reflective System by Pharo
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
Pharo1.4K views
Eclipse pdt indigo release review by Giang Nguyễn
Eclipse pdt   indigo release reviewEclipse pdt   indigo release review
Eclipse pdt indigo release review
Giang Nguyễn353 views
20100730 phpstudy by Yusuke Ando
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
Yusuke Ando1.1K views
Adding Semantics to Social Software Engineering (by Steffen Lohmann & Thomas ... by Wolfgang Reinhardt
Adding Semantics to Social Software Engineering (by Steffen Lohmann & Thomas ...Adding Semantics to Social Software Engineering (by Steffen Lohmann & Thomas ...
Adding Semantics to Social Software Engineering (by Steffen Lohmann & Thomas ...
Wolfgang Reinhardt2.1K views
Aspect oriented programming_with_spring by Guo Albert
Aspect oriented programming_with_springAspect oriented programming_with_spring
Aspect oriented programming_with_spring
Guo Albert978 views
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro... by Jorge Hidalgo
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...
Jorge Hidalgo4.6K views
Entity Framework Today (May 2012) by Julie Lerman
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
Julie Lerman1.1K views
Pharo: A Reflective System by Marcus Denker
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
Marcus Denker4.5K views
Living With Legacy Code by Rowan Merewood
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
Rowan Merewood25.3K views

More from Rafael Dohms

Application Metrics - IPC2023 by
Application Metrics - IPC2023Application Metrics - IPC2023
Application Metrics - IPC2023Rafael Dohms
7 views87 slides
How'd we get here? A guide to Architectural Decision Records by
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 RecordsRafael Dohms
306 views42 slides
Architectural Decision Records - PHPConfBR by
Architectural Decision Records - PHPConfBRArchitectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBRRafael Dohms
299 views42 slides
Application Metrics (with Prometheus examples) by
Application Metrics (with Prometheus examples)Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)Rafael Dohms
998 views89 slides
Application metrics - Confoo 2019 by
Application metrics - Confoo 2019Application metrics - Confoo 2019
Application metrics - Confoo 2019Rafael Dohms
747 views90 slides
Writing code you won’t hate tomorrow - PHPCE18 by
Writing code you won’t hate tomorrow - PHPCE18Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18Rafael Dohms
1.2K views86 slides

More from Rafael Dohms(20)

Application Metrics - IPC2023 by Rafael Dohms
Application Metrics - IPC2023Application Metrics - IPC2023
Application Metrics - IPC2023
Rafael Dohms7 views
How'd we get here? A guide to Architectural Decision Records by Rafael Dohms
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
Rafael Dohms306 views
Architectural Decision Records - PHPConfBR by Rafael Dohms
Architectural Decision Records - PHPConfBRArchitectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBR
Rafael Dohms299 views
Application Metrics (with Prometheus examples) by Rafael Dohms
Application Metrics (with Prometheus examples)Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)
Rafael Dohms998 views
Application metrics - Confoo 2019 by Rafael Dohms
Application metrics - Confoo 2019Application metrics - Confoo 2019
Application metrics - Confoo 2019
Rafael Dohms747 views
Writing code you won’t hate tomorrow - PHPCE18 by Rafael Dohms
Writing code you won’t hate tomorrow - PHPCE18Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18
Rafael Dohms1.2K views
Application Metrics (with Prometheus examples) #PHPDD18 by Rafael Dohms
Application Metrics (with Prometheus examples) #PHPDD18Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18
Rafael Dohms757 views
Application metrics with Prometheus - DPC18 by Rafael Dohms
Application metrics with Prometheus - DPC18Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18
Rafael Dohms1.3K views
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf by Rafael Dohms
“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
Rafael Dohms3.9K views
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo... by Rafael Dohms
“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...
Rafael Dohms1.4K views
Composer The Right Way - 010PHP by Rafael Dohms
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHP
Rafael Dohms3.5K views
Writing Code That Lasts - #Magento2Seminar, Utrecht by Rafael Dohms
Writing Code That Lasts - #Magento2Seminar, UtrechtWriting Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, Utrecht
Rafael Dohms976 views
Composer the Right Way - PHPSRB16 by Rafael Dohms
Composer the Right Way - PHPSRB16Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16
Rafael Dohms3.9K views
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16 by Rafael Dohms
“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
Rafael Dohms1.4K views
Composer the Right Way - MM16NL by Rafael Dohms
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
Rafael Dohms1.1K views
Composer The Right Way - PHPUGMRN by Rafael Dohms
Composer The Right Way - PHPUGMRNComposer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRN
Rafael Dohms1.4K views
Composer the Right Way - PHPBNL16 by Rafael Dohms
Composer the Right Way - PHPBNL16Composer the Right Way - PHPBNL16
Composer the Right Way - PHPBNL16
Rafael Dohms2.6K views
“Writing code that lasts” … or writing code you won’t hate tomorrow. by Rafael Dohms
“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.
Rafael Dohms2.5K views
A Journey into your Lizard Brain - PHP Conference Brasil 2015 by Rafael Dohms
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
Rafael Dohms2.2K views
“Writing code that lasts” … or writing code you won’t hate tomorrow. by Rafael Dohms
“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.
Rafael Dohms967 views

Recently uploaded

Roadmap to Become Experts.pptx by
Roadmap to Become Experts.pptxRoadmap to Become Experts.pptx
Roadmap to Become Experts.pptxdscwidyatamanew
11 views45 slides
Five Things You SHOULD Know About Postman by
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About PostmanPostman
25 views43 slides
STPI OctaNE CoE Brochure.pdf by
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdfmadhurjyapb
12 views1 slide
[2023] Putting the R! in R&D.pdf by
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdfEleanor McHugh
38 views127 slides
ChatGPT and AI for Web Developers by
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web DevelopersMaximiliano Firtman
174 views82 slides
Throughput by
ThroughputThroughput
ThroughputMoisés Armani Ramírez
32 views11 slides

Recently uploaded(20)

Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman25 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb12 views
[2023] Putting the R! in R&D.pdf by Eleanor McHugh
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh38 views
How the World's Leading Independent Automotive Distributor is Reinventing Its... by NUS-ISS
How the World's Leading Independent Automotive Distributor is Reinventing Its...How the World's Leading Independent Automotive Distributor is Reinventing Its...
How the World's Leading Independent Automotive Distributor is Reinventing Its...
NUS-ISS15 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software91 views
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze by NUS-ISS
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeDigital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
NUS-ISS19 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2214 views
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica... by NUS-ISS
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...
NUS-ISS15 views
Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
DALI Basics Course 2023 by Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg14 views
RADIUS-Omnichannel Interaction System by RADIUS
RADIUS-Omnichannel Interaction SystemRADIUS-Omnichannel Interaction System
RADIUS-Omnichannel Interaction System
RADIUS14 views
AI: mind, matter, meaning, metaphors, being, becoming, life values by Twain Liu 刘秋艳
AI: mind, matter, meaning, metaphors, being, becoming, life valuesAI: mind, matter, meaning, metaphors, being, becoming, life values
AI: mind, matter, meaning, metaphors, being, becoming, life values
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi113 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price12 views

Annotating with Annotations - ForumPHP 2012