SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
Aspects Everywhere:
                                           Language Extensibility for JDT
                                             through Equinox Aspects


                                                                      Andrew Eisenberg
                                                                       AJDT Committer
                                                                       AspectJ Project




Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
AJDT is an extension of JDT

                                                                 Extension
      AJDT                                                                                                           JDT
                                                                     of

                                              AspectJ JPython
              support for




                                                                                                                     support for
                                              Groovy And other
                 Tool




                                                                                                                        Tool
                                              Scala   Java-like
                                                      language
                                              JRuby
                                                                 Extension
   AspectJ                                                                                                           Java
                                                                     of
                                                                                                                          public class Ship {
             public aspect ShipAccessor {                                                                                   // ...
               // ...                                                                                                     }
             }




                                                                                                                                                2
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
A little more about AspectJ

      • Aspects
                – like classes, but can have pointcuts and
                  advice
      • Pointcuts
                – define interesting parts of the (execution of)
                  program
      • Advice
                – define extra behavior at interesting parts of
                  the program
      • Weaving (performed by a weaver)
                – makes sure advice runs at right time

                                                                                                                     3
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Demo 1


      • AJDT 1.6.1
                – Provides AspectJ-specific editor
                – But does not fully integrate with JDT




                                                                                                                     4
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
The problem


                                                                                                                     • Aspects are
                                                                                                                       not in Open
                                                                                                                       Type dialogs




                                                                                                                                      5
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
The problem

                                                                                                                     • What I
                                                                                                                       really want
                                                                                                                       is this




                                                                                                                                     6
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
JDT is not really extensible


  • The problem runs deep
            – Need to plug into JDT's Java model, but can't
            – Need to plug into JDT's source indexing, but can't
            – Need to plug into JDT's parser, but can't




                                                                                                                     7
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
First attempt: Raise a bug!


      • Bug 36939: Improve support for Java-like
        source files
                – Many patches submitted
                – 37 votes
                – but not resolved
      • Outside the scope of JDT




                                                                                                                     8
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Second attempt: eat our own
dogfood!

      JDT Weaving Service
      • Use AspectJ
                – add hooks to JDT
                – toggles JDT or extended functionality
      • Wrapped in Eclipse extension points
                – make extensible to third parties
      • Equinox Aspects to support load time
        weaving in OSGi environment
      • AJDT 1.6.2 and later

                                                                                                                     9
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Demo 2


      • AJDT 1.6.4
                – Uses JDT Weaving service
                – More fully integrated with JDT




                                                                                                                     10
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
How does this work?

                                       Uses
       AJDT                                                                                                          JDT
                                     extension
        UI                                                                                                            UI
                                                                                                         Weaves
                                       points   JDT
                                                                                                          into
                                              Weaving
                                                                                                                     JDT
       AJDT                                    Service
                                                                                                                     Core
       Core

                                                                                                                             Other
                    Load Time                                                                                               bundles...
                     Weaving class
                             loading
             Equinox            &
             Aspects OSGi, everything
                   In                                                                                                 is a bundle
                            extension
                             support

                                                        Equinox-OSGi                                                                     11
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Equinox Aspects uses AspectJ
weaver

      • The weaver is careful which bundles to
        touch
      • Weaving happens lazily as classes are
        loaded
                – little effect on startup time
      • Once woven, weaver has no more role




                                                                                                                     12
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Example: Plug into JDT's Java
model

      • For when it's like Java, but it really isn't
      • Need to plug into JDT's Java element
        hierarchy
                – IJavaElement --- generic Java entity
                – ICompilationUnit --- A Java source file
      • Objects need to be instantiated at the
        right time




                                                                                                                     13
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Example: Plug into JDT's Java
model

      1. Define extension:
                <extension point=quot;org.eclipse.contribution.weaving.jdt.cuproviderquot;>
                             <provider class=quot;org.eclipse.ajdt.eclipsecon2009.ShipCUProviderquot;
                                                     file_extension=quot;shipquot;/>
                </extension>

      2. Define compilation unit provider:
           public class ShipCUProvider implements ICompilationUnitProvider {
                     public CompilationUnit create(PackageFragment parent, String name,
                                        WorkingCopyOwner owner) {
                          return new ShipCompilationUnit(parent, name, owner);
           }




                                                                                                                     14
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Demo 3/4


      • Simple Ship editor
                – Icons
                – Searching
                – Open type
      • Ship Editor source code
                – plugin.xml
                – Java source code




                                                                                                                     15
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
JDT Weaving Service


      • JDT functionality is exposed
                –      AspectJ advice and pointcuts
                –      exposed as extension points
                –      no need to be AspectJ aware
                –      simple and Eclipse-friendly
      • Available for download
                – with AJDT or separately
                http://download.eclipse.org/tools/ajdt/34/update
      • Useful for any Java-like language
                – Scala Eclipse plugin using this now
                                                                                                                     16
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
That's it!


      • Links
                – AJDT : http://eclipse.org/ajdt
                – Equinox Aspects :
                  http://www.eclipse.org/equinox/incubator/aspects/index.php
                – Source code and more implementation details :
                  http://contraptionsforprogramming.blogspot.com
                – AspectJ in Action by Ramnivas Laddad available at bookstore




                                                                                                                     17
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
CompilationUnitProviderAspect

 pointcut compilationUnitCreations(PackageFragment parent,
                                   String name, WorkingCopyOwner owner) :
          call(public CompilationUnit.new(PackageFragment,
                                          String, WorkingCopyOwner)) &&
          args(parent, name, owner);

 CompilationUnit around(PackageFragment parent,
                        String name, WorkingCopyOwner owner) :
             compilationUnitCreations(parent, name, owner) {

           String fileExtension = findFileExtension(name);
           ICompilationUnitProvider provider =
                        CompilationUnitProviderRegistry.getInstance()
                        .getProvider(fileExtension);
           if (provider != null)
               return provider.create(parent, name, owner);
           return proceed(parent, name, owner);
 }




                                                                                                                     18
Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.

Más contenido relacionado

Destacado

Ciga 1
Ciga 1Ciga 1
Ciga 1JNR
 
ε1 μέδουσα
ε1 μέδουσαε1 μέδουσα
ε1 μέδουσαpefstathiou
 
Initiative 2020 - Thal In Bewegung
Initiative 2020 - Thal In BewegungInitiative 2020 - Thal In Bewegung
Initiative 2020 - Thal In Bewegungguesta3da88
 
البيان الختامي والتوصيات
البيان الختامي والتوصياتالبيان الختامي والتوصيات
البيان الختامي والتوصياتMohamed Mahdy
 
5-Fh_Heidelberg_Organisationstheorien_Taylorismus
5-Fh_Heidelberg_Organisationstheorien_Taylorismus5-Fh_Heidelberg_Organisationstheorien_Taylorismus
5-Fh_Heidelberg_Organisationstheorien_TaylorismusTobias Illig
 
ΣΤ2 Σύρος
ΣΤ2 ΣύροςΣΤ2 Σύρος
ΣΤ2 Σύροςpefstathiou
 
Tut peterschrotter bs_02_grundlagen_analog
Tut peterschrotter bs_02_grundlagen_analogTut peterschrotter bs_02_grundlagen_analog
Tut peterschrotter bs_02_grundlagen_analogstrychnine
 
Levantamento de brincadeiras publicar
Levantamento de brincadeiras publicarLevantamento de brincadeiras publicar
Levantamento de brincadeiras publicarSacramento-Carvalho
 
Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...
Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...
Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...Estevão Hess
 
Στ2 Ηρακλειά
Στ2 ΗρακλειάΣτ2 Ηρακλειά
Στ2 Ηρακλειάpefstathiou
 
Israele palestina som_
Israele palestina som_Israele palestina som_
Israele palestina som_pppmm
 
Social Media für Einsteiger 11 Tipps
Social Media für Einsteiger 11 TippsSocial Media für Einsteiger 11 Tipps
Social Media für Einsteiger 11 TippsBrigitte Rossa
 

Destacado (20)

Ciga 1
Ciga 1Ciga 1
Ciga 1
 
22º dia pdf
22º dia   pdf22º dia   pdf
22º dia pdf
 
7º dia
7º dia7º dia
7º dia
 
19º dia pdf
19º dia   pdf19º dia   pdf
19º dia pdf
 
ε1 μέδουσα
ε1 μέδουσαε1 μέδουσα
ε1 μέδουσα
 
Initiative 2020 - Thal In Bewegung
Initiative 2020 - Thal In BewegungInitiative 2020 - Thal In Bewegung
Initiative 2020 - Thal In Bewegung
 
Recomendaciones para despues de una exodoncia
Recomendaciones para despues de una exodonciaRecomendaciones para despues de una exodoncia
Recomendaciones para despues de una exodoncia
 
البيان الختامي والتوصيات
البيان الختامي والتوصياتالبيان الختامي والتوصيات
البيان الختامي والتوصيات
 
5-Fh_Heidelberg_Organisationstheorien_Taylorismus
5-Fh_Heidelberg_Organisationstheorien_Taylorismus5-Fh_Heidelberg_Organisationstheorien_Taylorismus
5-Fh_Heidelberg_Organisationstheorien_Taylorismus
 
Kap1
Kap1Kap1
Kap1
 
ΣΤ2 Σύρος
ΣΤ2 ΣύροςΣΤ2 Σύρος
ΣΤ2 Σύρος
 
Tut peterschrotter bs_02_grundlagen_analog
Tut peterschrotter bs_02_grundlagen_analogTut peterschrotter bs_02_grundlagen_analog
Tut peterschrotter bs_02_grundlagen_analog
 
Conduce con cuidado
Conduce con cuidadoConduce con cuidado
Conduce con cuidado
 
Bons Conselhos
Bons ConselhosBons Conselhos
Bons Conselhos
 
Levantamento de brincadeiras publicar
Levantamento de brincadeiras publicarLevantamento de brincadeiras publicar
Levantamento de brincadeiras publicar
 
Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...
Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...
Follow-the-Sun: Um Processo para Minimizar as Dificuldades de Projetos que Ad...
 
Στ2 Ηρακλειά
Στ2 ΗρακλειάΣτ2 Ηρακλειά
Στ2 Ηρακλειά
 
Israele palestina som_
Israele palestina som_Israele palestina som_
Israele palestina som_
 
Social Media für Einsteiger 11 Tipps
Social Media für Einsteiger 11 TippsSocial Media für Einsteiger 11 Tipps
Social Media für Einsteiger 11 Tipps
 
Vocabulario
VocabularioVocabulario
Vocabulario
 

Similar a Aspects Every Where

Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009Guillaume Laforge
 
Groovy-Eclipse at Eclipsecon2010
Groovy-Eclipse at Eclipsecon2010Groovy-Eclipse at Eclipsecon2010
Groovy-Eclipse at Eclipsecon2010guest9ff00
 
Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009
Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009
Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009Guillaume Laforge
 
Groovy and Grails in Google App Engine
Groovy and Grails in Google App EngineGroovy and Grails in Google App Engine
Groovy and Grails in Google App EngineGuillaume Laforge
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP IntroductionIwein Fuld
 
[Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic [Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic Challenge:Future
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6Gal Marder
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYBnukeevry1
 
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?Miles Sabin
 
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?Miles Sabin
 
GR8Conf 2009. The Grails Plugin System by Graeme Rocher
GR8Conf 2009. The Grails Plugin System by Graeme RocherGR8Conf 2009. The Grails Plugin System by Graeme Rocher
GR8Conf 2009. The Grails Plugin System by Graeme RocherGR8Conf
 
Whats Cool in Java E 6
Whats Cool in Java E 6Whats Cool in Java E 6
Whats Cool in Java E 6Arun Gupta
 
Server Day 2009: Spring dm Server by Alef Arendsen
Server Day 2009: Spring dm Server by Alef ArendsenServer Day 2009: Spring dm Server by Alef Arendsen
Server Day 2009: Spring dm Server by Alef ArendsenJUG Genova
 
Eclipsecon 2010 - Scala Support in Eclipse
Eclipsecon 2010 - Scala Support in EclipseEclipsecon 2010 - Scala Support in Eclipse
Eclipsecon 2010 - Scala Support in EclipseMiles Sabin
 

Similar a Aspects Every Where (16)

Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
 
Groovy-Eclipse at Eclipsecon2010
Groovy-Eclipse at Eclipsecon2010Groovy-Eclipse at Eclipsecon2010
Groovy-Eclipse at Eclipsecon2010
 
Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009
Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009
Introduction to Groovy and what's New in Groovy 1.6 - SpringOne Europe 2009
 
Groovy and Grails in Google App Engine
Groovy and Grails in Google App EngineGroovy and Grails in Google App Engine
Groovy and Grails in Google App Engine
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP Introduction
 
BeJUG - Di With Spring
BeJUG - Di With SpringBeJUG - Di With Spring
BeJUG - Di With Spring
 
[Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic [Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Jcp adopt jsr
Jcp adopt jsrJcp adopt jsr
Jcp adopt jsr
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYB
 
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
JVM Languages Support in Eclipse - Monkey-patching the JDT for fun and profit?
 
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
 
GR8Conf 2009. The Grails Plugin System by Graeme Rocher
GR8Conf 2009. The Grails Plugin System by Graeme RocherGR8Conf 2009. The Grails Plugin System by Graeme Rocher
GR8Conf 2009. The Grails Plugin System by Graeme Rocher
 
Whats Cool in Java E 6
Whats Cool in Java E 6Whats Cool in Java E 6
Whats Cool in Java E 6
 
Server Day 2009: Spring dm Server by Alef Arendsen
Server Day 2009: Spring dm Server by Alef ArendsenServer Day 2009: Spring dm Server by Alef Arendsen
Server Day 2009: Spring dm Server by Alef Arendsen
 
Eclipsecon 2010 - Scala Support in Eclipse
Eclipsecon 2010 - Scala Support in EclipseEclipsecon 2010 - Scala Support in Eclipse
Eclipsecon 2010 - Scala Support in Eclipse
 

Último

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Último (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Aspects Every Where

  • 1. Aspects Everywhere: Language Extensibility for JDT through Equinox Aspects Andrew Eisenberg AJDT Committer AspectJ Project Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 2. AJDT is an extension of JDT Extension AJDT JDT of AspectJ JPython support for support for Groovy And other Tool Tool Scala Java-like language JRuby Extension AspectJ Java of public class Ship { public aspect ShipAccessor { // ... // ... } } 2 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 3. A little more about AspectJ • Aspects – like classes, but can have pointcuts and advice • Pointcuts – define interesting parts of the (execution of) program • Advice – define extra behavior at interesting parts of the program • Weaving (performed by a weaver) – makes sure advice runs at right time 3 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 4. Demo 1 • AJDT 1.6.1 – Provides AspectJ-specific editor – But does not fully integrate with JDT 4 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 5. The problem • Aspects are not in Open Type dialogs 5 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 6. The problem • What I really want is this 6 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 7. JDT is not really extensible • The problem runs deep – Need to plug into JDT's Java model, but can't – Need to plug into JDT's source indexing, but can't – Need to plug into JDT's parser, but can't 7 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 8. First attempt: Raise a bug! • Bug 36939: Improve support for Java-like source files – Many patches submitted – 37 votes – but not resolved • Outside the scope of JDT 8 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 9. Second attempt: eat our own dogfood! JDT Weaving Service • Use AspectJ – add hooks to JDT – toggles JDT or extended functionality • Wrapped in Eclipse extension points – make extensible to third parties • Equinox Aspects to support load time weaving in OSGi environment • AJDT 1.6.2 and later 9 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 10. Demo 2 • AJDT 1.6.4 – Uses JDT Weaving service – More fully integrated with JDT 10 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 11. How does this work? Uses AJDT JDT extension UI UI Weaves points JDT into Weaving JDT AJDT Service Core Core Other Load Time bundles... Weaving class loading Equinox & Aspects OSGi, everything In is a bundle extension support Equinox-OSGi 11 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 12. Equinox Aspects uses AspectJ weaver • The weaver is careful which bundles to touch • Weaving happens lazily as classes are loaded – little effect on startup time • Once woven, weaver has no more role 12 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 13. Example: Plug into JDT's Java model • For when it's like Java, but it really isn't • Need to plug into JDT's Java element hierarchy – IJavaElement --- generic Java entity – ICompilationUnit --- A Java source file • Objects need to be instantiated at the right time 13 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 14. Example: Plug into JDT's Java model 1. Define extension: <extension point=quot;org.eclipse.contribution.weaving.jdt.cuproviderquot;> <provider class=quot;org.eclipse.ajdt.eclipsecon2009.ShipCUProviderquot; file_extension=quot;shipquot;/> </extension> 2. Define compilation unit provider: public class ShipCUProvider implements ICompilationUnitProvider { public CompilationUnit create(PackageFragment parent, String name, WorkingCopyOwner owner) { return new ShipCompilationUnit(parent, name, owner); } 14 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 15. Demo 3/4 • Simple Ship editor – Icons – Searching – Open type • Ship Editor source code – plugin.xml – Java source code 15 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 16. JDT Weaving Service • JDT functionality is exposed – AspectJ advice and pointcuts – exposed as extension points – no need to be AspectJ aware – simple and Eclipse-friendly • Available for download – with AJDT or separately http://download.eclipse.org/tools/ajdt/34/update • Useful for any Java-like language – Scala Eclipse plugin using this now 16 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 17. That's it! • Links – AJDT : http://eclipse.org/ajdt – Equinox Aspects : http://www.eclipse.org/equinox/incubator/aspects/index.php – Source code and more implementation details : http://contraptionsforprogramming.blogspot.com – AspectJ in Action by Ramnivas Laddad available at bookstore 17 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 18. CompilationUnitProviderAspect pointcut compilationUnitCreations(PackageFragment parent, String name, WorkingCopyOwner owner) : call(public CompilationUnit.new(PackageFragment, String, WorkingCopyOwner)) && args(parent, name, owner); CompilationUnit around(PackageFragment parent, String name, WorkingCopyOwner owner) : compilationUnitCreations(parent, name, owner) { String fileExtension = findFileExtension(name); ICompilationUnitProvider provider = CompilationUnitProviderRegistry.getInstance() .getProvider(fileExtension); if (provider != null) return provider.create(parent, name, owner); return proceed(parent, name, owner); } 18 Copyright 2008 SpringSource. Copying, publishing or distributing without express written permission is prohibited.