SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Experiences using Equinox Aspects
      in a real-world project


                                         Martin Lippert (akquinet it-agile GmbH)
                                           Heiko Seeberger (metafinanz GmbH)




© 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license | April 24th, 2008
Overview
• Quick overview of AOP
• AOP in the OSGi world?
    What does it mean?
• Equinox Aspects: Aspect Weaving for OSGi
    Introduction
    Demo
    Real-world project: Allianz Business System
• What’s next for Equinox Aspects?
• Conclusions



  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Aspect-oriented programming
• Modularity improved a lot by OO concepts
    Classes, interfaces
    Information hiding, polymorphism, inheritance
• AOP adds additional concepts
    To modularize so called “cross-cutting concerns”


        ClassA                   ClassB                   ClassC                             AspectX

                               ConcernX
      ConcernX                                                                              ConcernX
                                                        ConcernX




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
AOP today
• Meanwhile AOP is an established concept
    Useful for many situations
    Mostly technology-centric usage scenarios
• Established languages and frameworks available
    AspectJ: powerful language extension to Java
    Spring-AOP: simple to use AOP for enterprise apps
• Used in production:
    Spring itself makes heavy use of AOP concepts
    App-servers are using AOP inside
    Direct AOP selectively used in enterprise apps



  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
AspectJ = AOP for Java
• AspectJ is a powerful language extension for Java
    Hosted as an Eclipse project
    Still very active (latest release Dezember 2007, upcoming
     release 1.6.0 close)
• AJDT:
    Great tooling for the Eclipse IDE
    Comes close to the JDT feeling
• Spring-IDE:
    Integrates AJDT with Spring-AOP
    AJDT feeling for Spring apps



  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
The Standard Use Case



            ClassA                   ClassB                   ClassC                             AspectX

                                   ConcernX
          ConcernX                                                                              ConcernX
                                                            ConcernX



  Project Sources

                                                                               Single Application Classpath

                                             Java Virtual Machine



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Library Aspects



            ClassA                   ClassB                   ClassC                             AspectX

                                   ConcernX
          ConcernX                                                                              ConcernX
                                                            ConcernX



  Project Sources                                                                         JAR

                                                                               Single Application Classpath

                                             Java Virtual Machine



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Aspects for Existing Code



            ClassA                             ClassB                   ClassC                   AspectX

                                             ConcernX
          ConcernX                                                                              ConcernX
                                                                      ConcernX



  JARs                                Project Sources

                                                                               Single Application Classpath

                                             Java Virtual Machine



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Java™ + OSGi™
• OSGi™:
    “A dynamic module system for Java™”


• Modularity
• Dynamic
• Service-Oriented




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
What does it mean for us?
• We would like to modularize
    … classes and interfaces into bundles
    … and aspects into bundles

• The obvious next step:
    modularize cross-cutting concerns into bundles

• Takes modularity to the next level




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Intra-Bundle Aspects



          ClassA                   ClassB                                        ClassC                  AspectX


                                                                                                       ConcernX
                                                                               ConcernX



                     Bundle A                                                               Bundle B

              Bundle-Classpath                                                       Bundle-Classpath

                                               Java Virtual Machine



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Co-Op Bundle Aspects



     ClassA                   ClassB                              ClassC                                 AspectX

                            ConcernX
   ConcernX                                                                                            ConcernX
                                                                ConcernX



                Bundle A                                        Bundle B                                 Bundle C

         Bundle-Classpath                                   Bundle-Classpath                      Bundle-Classpath

                                               Java Virtual Machine



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Abstract Aspect Bundles



         ClassA                   ClassB                                                                  Abstract
                                                               Concrete
                                                                                                          Aspect
                                                                Aspect
                               ConcernX
      ConcernX
                                                                                                         ConcernX
                                                              ConcernX


                                   Bundle A                                                              Bundle B

                                                             Bundle-Classpath                      Bundle-Classpath

                                               Java Virtual Machine



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Dynamics for Aspect Bundles
• OSGi allows dynamic bundle
    … installs
    … uninstalls
    … updates

• Same should be possible for aspect bundles
    … dynamic installs, uninstalls and updates of aspect bundles
    … dynamic installs, uninstalls and updates of bundles that are
     affected by aspect bundles




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Equinox Aspects
• Equinox Incubator Project
    http://www.eclipse.org/equinox/incubator/aspects


• Enables AspectJ/AOP usage for OSGi
    Supports all presented use-cases
    Ready-to-use

• Setting
    Works with Eclipse 3.3 and 3.4
    Works with AJDT 1.5.1, 1.5.2, 1.6.0



  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Features
• Load-time aspect weaving
    No recompilation of existing bundles necessary
    Supports full aop.xml load-time weaving config of AspectJ
• Caching for woven classes
       Load-time weaving happens only once
   
       Second time startup is same as without aspects
   
       Available for standard JREs and IBM J9 shared classes
   
       Supports configuration switching
   
• Dynamic installation of aspect bundles
    Silent update of bundles to be woven again
    Those bundles must behave nicely within dynamic situations


  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
How to use Equinox Aspects?




 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Install AJDT
• AJDT contains:
    AspectJ runtime libraries.
    AspectJ integration into SDK (tooling).
• Supported versions (Eclipse 3.3):
    1.5.1 → AspectJ 1.5.4
    1.5.2 → AspectJ 1.6
• www.eclipse.org/ajdt




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Install Equinox Aspects
• Download Equinox Aspects 1.1.0 from www.eclipse.org/
  equinox/incubator/aspects.
• Install into Eclipse installation directory,
  do not use an extension location!
• Alternatively define a target which co-locates
  org.aspectj.osgi and org.eclipse.osgi.




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Co-locate org.*.osgi




 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
How to write an aspect bundle?
• “Hello world!” on Equinox Console:




• Aspect shaking the output:




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
How to write an aspect bundle?
• Create a plug-in project.
• Add AspectJ nature.
• Write your aspects.
• Export packages containing aspects.



                                                    Demo …




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
How to write an aspect bundle?
• Define your aspects in aop.xml.
• Export packages containing aop.xml files.
• Re-export dependency on org.aspectj.runtime bundle.




                                                    Demo …




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
How to write an aspect bundle?
• The aspect bundle must define the “target”:
    Which bundles are to be woven?
• Use Eclipse-SupplementBundle header.
                      Eclipse-SupplementBundle: demo.*


                                                                                               Bundle demo.a
                                             demo.*
 Aspect bundle                                                                                 Bundle demo.b
                                                                                                    Bundle xyz

                                                    Demo …
  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
How to configure Equinox Aspects?
• Tell Equinox to use the Equinox Aspects framework
  extension:
       -Dosgi.framework.extensions=org.aspectj.osgi


• Declare where to find aop.xml-files:
      -Dorg.aspectj.weaver.loadtime.configuration=
                   org/aspectj/aop.xml




                                                    Demo …
  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Is there a real-world project?
• Allianz Business System (ABS)
    Mission critical system at the core of the insurance business.
    Addresses all major concerns in the various classes of
     insurance.
    Online, offline and integration scenarios.
• ABS Client
    Rich Client application for
           call center and
           clerks.




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
ABS Client architecture

UI:
PowerBuilder (Native)                                                  Java-PowerBuilder
                                                                        Abstract UI (DSL)
Business Logic:
Eclipse Plug-ins


Persistence:
“Orbit” (Java ORM)

                                                                           A3k framework
 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Top requirements for mission critical systems




                 Availability
                                                 Performance
                                                                                        Features




 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
How to ensure performance?




                 Availability
                                                 Performance
                                                                                        Features



                                 Performance logging!


 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Performance logging
• Define service level agreements for critical processes.
    E.g.: “Customer-search must show result within two seconds.”


• Measure the execution of these processes.

• Analyze and report the measured data.




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Performance logging
• Define service level agreements for critical processes.
    E.g.: “Customer-search must show result within two seconds.”


• Measure the execution of these processes:
    Log start time.
    Log end time.


• Analyze and report the measured data.




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Challenge: Performance Logging

UI:
PowerBuilder (Native)                                        Java-PB                                     end

                                                                                                                  DSL
                                                                           start
Business Logic:
Eclipse Plug-ins


Persistence:
“Orbit” (Java ORM)



 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
Challenge: Performance Logging



                                                              Java-PB                                     end

                                                                                                                   DSL
                                                                            start


• Start points in generated code!
• End points in framework code!
⇒ No way to use standard Java.
⇒ Only AOP / AspectJ applies.


  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Why use load-time weaving?
• Recompiling of framework code not allowed
    But end-points of measurement in framework code
    Load-time weaving easy to use for all kinds of bundles


• Compile-time weaving was not mature in PDE build!
    We used Eclipse 3.2.0
    Building AspectJ in PDE only possible with AJDT patch
     available since AJDT 1.4.1 (for Eclipse 3.2.1)
    We tried, but …




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
For more info on this success story …



                 … read the article
         “Performance-Logging mit AspectJ”
    in the upcoming Eclipse Magazin (Vol. 15).




 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license
What’s next for Equinox Aspects?
• “Ease of Use”
    Quick start tutorial
    More examples
    Maybe cheat sheets
• Advanced tooling
    Bring AJDT navigation and debugging features to OSGi
• More dynamics
• Improved caching
• Graduation… 



  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Conclusions
• Equinox Aspects brings full AOP to OSGi
    Via integrated load-time weaving
    Combines OSGi and AOP modularity features
• Can be used for production systems today

• Give it a try
  http://www.eclipse.org/equinox/incubator




  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
  Commons Att. Nc Nd 2.5 license
Thank you for your attention!


Q&A


Heiko Seeberger: heiko.seeberger@metafinanz.de
Martin Lippert: martin.lippert@akquinet.de




 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative
 Commons Att. Nc Nd 2.5 license

Más contenido relacionado

Más de Heiko Seeberger

RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?Heiko Seeberger
 
Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Heiko Seeberger
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewHeiko Seeberger
 
OSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaOSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaHeiko Seeberger
 
JAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsJAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsHeiko Seeberger
 
Eclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractEclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractHeiko Seeberger
 
Eclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiEclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiHeiko Seeberger
 
Eclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingEclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingHeiko Seeberger
 
Eclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxEclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxHeiko Seeberger
 
Eclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterEclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterHeiko Seeberger
 

Más de Heiko Seeberger (20)

Java Magazin - Lift
Java Magazin - LiftJava Magazin - Lift
Java Magazin - Lift
 
JavaSPEKTRUM - Scala 3
JavaSPEKTRUM - Scala 3JavaSPEKTRUM - Scala 3
JavaSPEKTRUM - Scala 3
 
JavaSPEKTRUM - Scala 2
JavaSPEKTRUM - Scala 2JavaSPEKTRUM - Scala 2
JavaSPEKTRUM - Scala 2
 
JavaSPEKTRUM - Scala 1
JavaSPEKTRUM - Scala 1JavaSPEKTRUM - Scala 1
JavaSPEKTRUM - Scala 1
 
RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?RheinJUG 2010 - Sprechen Sie Scala?
RheinJUG 2010 - Sprechen Sie Scala?
 
Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?Objektforum 2010 - Sprechen Sie Scala?
Objektforum 2010 - Sprechen Sie Scala?
 
W-JAX 09 - ScalaModules
W-JAX 09 - ScalaModulesW-JAX 09 - ScalaModules
W-JAX 09 - ScalaModules
 
W-JAX 09 - Lift
W-JAX 09 - LiftW-JAX 09 - Lift
W-JAX 09 - Lift
 
JM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala ReviewJM 08/09 - Beginning Scala Review
JM 08/09 - Beginning Scala Review
 
JM 08/09 - ScalaModules
JM 08/09 - ScalaModulesJM 08/09 - ScalaModules
JM 08/09 - ScalaModules
 
OSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on ScalaOSGi DevCon Europe 09 - OSGi on Scala
OSGi DevCon Europe 09 - OSGi on Scala
 
JAX 09 - OSGi on Scala
JAX 09 - OSGi on ScalaJAX 09 - OSGi on Scala
JAX 09 - OSGi on Scala
 
JAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components ModelsJAX 09 - OSGi Service Components Models
JAX 09 - OSGi Service Components Models
 
JAX 08 - Agile RCP
JAX 08 - Agile RCPJAX 08 - Agile RCP
JAX 08 - Agile RCP
 
Eclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by ContractEclipse Magazin 12 - Design by Contract
Eclipse Magazin 12 - Design by Contract
 
JUGM 07 - AspectJ
JUGM 07 - AspectJJUGM 07 - AspectJ
JUGM 07 - AspectJ
 
Eclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der DreiEclipse Magazin 16 - Die Stärke der Drei
Eclipse Magazin 16 - Die Stärke der Drei
 
Eclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance LoggingEclipse Magazin15 - Performance Logging
Eclipse Magazin15 - Performance Logging
 
Eclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on EquinoxEclipse Magazin 14 - Getting hooked on Equinox
Eclipse Magazin 14 - Getting hooked on Equinox
 
Eclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matterEclipse Magazin 12 - Security does matter
Eclipse Magazin 12 - Security does matter
 

Último

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
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 Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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 MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Último (20)

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

JAX 08 - Experiences using Equinox Aspects in a real-world Project

  • 1. Experiences using Equinox Aspects in a real-world project Martin Lippert (akquinet it-agile GmbH) Heiko Seeberger (metafinanz GmbH) © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license | April 24th, 2008
  • 2. Overview • Quick overview of AOP • AOP in the OSGi world?  What does it mean? • Equinox Aspects: Aspect Weaving for OSGi  Introduction  Demo  Real-world project: Allianz Business System • What’s next for Equinox Aspects? • Conclusions Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 3. Aspect-oriented programming • Modularity improved a lot by OO concepts  Classes, interfaces  Information hiding, polymorphism, inheritance • AOP adds additional concepts  To modularize so called “cross-cutting concerns” ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 4. AOP today • Meanwhile AOP is an established concept  Useful for many situations  Mostly technology-centric usage scenarios • Established languages and frameworks available  AspectJ: powerful language extension to Java  Spring-AOP: simple to use AOP for enterprise apps • Used in production:  Spring itself makes heavy use of AOP concepts  App-servers are using AOP inside  Direct AOP selectively used in enterprise apps Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 5. AspectJ = AOP for Java • AspectJ is a powerful language extension for Java  Hosted as an Eclipse project  Still very active (latest release Dezember 2007, upcoming release 1.6.0 close) • AJDT:  Great tooling for the Eclipse IDE  Comes close to the JDT feeling • Spring-IDE:  Integrates AJDT with Spring-AOP  AJDT feeling for Spring apps Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 6. The Standard Use Case ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Project Sources Single Application Classpath Java Virtual Machine Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 7. Library Aspects ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Project Sources JAR Single Application Classpath Java Virtual Machine Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 8. Aspects for Existing Code ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX JARs Project Sources Single Application Classpath Java Virtual Machine Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 9. Java™ + OSGi™ • OSGi™:  “A dynamic module system for Java™” • Modularity • Dynamic • Service-Oriented Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 10. What does it mean for us? • We would like to modularize  … classes and interfaces into bundles  … and aspects into bundles • The obvious next step:  modularize cross-cutting concerns into bundles • Takes modularity to the next level Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 11. Intra-Bundle Aspects ClassA ClassB ClassC AspectX ConcernX ConcernX Bundle A Bundle B Bundle-Classpath Bundle-Classpath Java Virtual Machine Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 12. Co-Op Bundle Aspects ClassA ClassB ClassC AspectX ConcernX ConcernX ConcernX ConcernX Bundle A Bundle B Bundle C Bundle-Classpath Bundle-Classpath Bundle-Classpath Java Virtual Machine Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 13. Abstract Aspect Bundles ClassA ClassB Abstract Concrete Aspect Aspect ConcernX ConcernX ConcernX ConcernX Bundle A Bundle B Bundle-Classpath Bundle-Classpath Java Virtual Machine Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 14. Dynamics for Aspect Bundles • OSGi allows dynamic bundle  … installs  … uninstalls  … updates • Same should be possible for aspect bundles  … dynamic installs, uninstalls and updates of aspect bundles  … dynamic installs, uninstalls and updates of bundles that are affected by aspect bundles Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 15. Equinox Aspects • Equinox Incubator Project  http://www.eclipse.org/equinox/incubator/aspects • Enables AspectJ/AOP usage for OSGi  Supports all presented use-cases  Ready-to-use • Setting  Works with Eclipse 3.3 and 3.4  Works with AJDT 1.5.1, 1.5.2, 1.6.0 Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 16. Features • Load-time aspect weaving  No recompilation of existing bundles necessary  Supports full aop.xml load-time weaving config of AspectJ • Caching for woven classes Load-time weaving happens only once  Second time startup is same as without aspects  Available for standard JREs and IBM J9 shared classes  Supports configuration switching  • Dynamic installation of aspect bundles  Silent update of bundles to be woven again  Those bundles must behave nicely within dynamic situations Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 17. How to use Equinox Aspects? Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 18. Install AJDT • AJDT contains:  AspectJ runtime libraries.  AspectJ integration into SDK (tooling). • Supported versions (Eclipse 3.3):  1.5.1 → AspectJ 1.5.4  1.5.2 → AspectJ 1.6 • www.eclipse.org/ajdt Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 19. Install Equinox Aspects • Download Equinox Aspects 1.1.0 from www.eclipse.org/ equinox/incubator/aspects. • Install into Eclipse installation directory, do not use an extension location! • Alternatively define a target which co-locates org.aspectj.osgi and org.eclipse.osgi. Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 20. Co-locate org.*.osgi Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 21. How to write an aspect bundle? • “Hello world!” on Equinox Console: • Aspect shaking the output: Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 22. How to write an aspect bundle? • Create a plug-in project. • Add AspectJ nature. • Write your aspects. • Export packages containing aspects. Demo … Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 23. How to write an aspect bundle? • Define your aspects in aop.xml. • Export packages containing aop.xml files. • Re-export dependency on org.aspectj.runtime bundle. Demo … Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 24. How to write an aspect bundle? • The aspect bundle must define the “target”:  Which bundles are to be woven? • Use Eclipse-SupplementBundle header. Eclipse-SupplementBundle: demo.* Bundle demo.a demo.* Aspect bundle Bundle demo.b Bundle xyz Demo … Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 25. How to configure Equinox Aspects? • Tell Equinox to use the Equinox Aspects framework extension: -Dosgi.framework.extensions=org.aspectj.osgi • Declare where to find aop.xml-files: -Dorg.aspectj.weaver.loadtime.configuration= org/aspectj/aop.xml Demo … Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 26. Is there a real-world project? • Allianz Business System (ABS)  Mission critical system at the core of the insurance business.  Addresses all major concerns in the various classes of insurance.  Online, offline and integration scenarios. • ABS Client  Rich Client application for  call center and  clerks. Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 27. ABS Client architecture UI: PowerBuilder (Native) Java-PowerBuilder Abstract UI (DSL) Business Logic: Eclipse Plug-ins Persistence: “Orbit” (Java ORM) A3k framework Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 28. Top requirements for mission critical systems Availability Performance Features Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 29. How to ensure performance? Availability Performance Features Performance logging! Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 30. Performance logging • Define service level agreements for critical processes.  E.g.: “Customer-search must show result within two seconds.” • Measure the execution of these processes. • Analyze and report the measured data. Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 31. Performance logging • Define service level agreements for critical processes.  E.g.: “Customer-search must show result within two seconds.” • Measure the execution of these processes:  Log start time.  Log end time. • Analyze and report the measured data. Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 32. Challenge: Performance Logging UI: PowerBuilder (Native) Java-PB end DSL start Business Logic: Eclipse Plug-ins Persistence: “Orbit” (Java ORM) Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 33. Challenge: Performance Logging Java-PB end DSL start • Start points in generated code! • End points in framework code! ⇒ No way to use standard Java. ⇒ Only AOP / AspectJ applies. Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 34. Why use load-time weaving? • Recompiling of framework code not allowed  But end-points of measurement in framework code  Load-time weaving easy to use for all kinds of bundles • Compile-time weaving was not mature in PDE build!  We used Eclipse 3.2.0  Building AspectJ in PDE only possible with AJDT patch available since AJDT 1.4.1 (for Eclipse 3.2.1)  We tried, but … Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 35. For more info on this success story … … read the article “Performance-Logging mit AspectJ” in the upcoming Eclipse Magazin (Vol. 15). Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 36. What’s next for Equinox Aspects? • “Ease of Use”  Quick start tutorial  More examples  Maybe cheat sheets • Advanced tooling  Bring AJDT navigation and debugging features to OSGi • More dynamics • Improved caching • Graduation…  Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 37. Conclusions • Equinox Aspects brings full AOP to OSGi  Via integrated load-time weaving  Combines OSGi and AOP modularity features • Can be used for production systems today • Give it a try http://www.eclipse.org/equinox/incubator Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license
  • 38. Thank you for your attention! Q&A Heiko Seeberger: heiko.seeberger@metafinanz.de Martin Lippert: martin.lippert@akquinet.de Experiences using Equinox Aspects in a real-world project | © 2008 by Heiko Seeberger, Martin Lippert; made available under Creative Commons Att. Nc Nd 2.5 license