SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
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

Contenu connexe

Plus 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
 

Plus 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
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

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