GAP: Generic Aspects for PHP

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

  • + guestfaa1dae guestfaa1dae 6 months ago
    Can you please show a simple task without and then with aspects?
Post a comment
Embed Video
Edit your comment Cancel

1 Favorite

GAP: Generic Aspects for PHP - Presentation Transcript

  1. GAP: G eneric A spects for P HP
      • Sebastian Bergmann Günter Kniesel
      • <sb@ez.no> <gk@cs.uni-bonn.de>
    3 rd European Workshop on Aspects in Software University of Twente, Enschede, The Netherlands August 31, 2006
    • The dominant programming language in Web-based development.
      • Easy to learn.
      • Designed for the Web.
      • Good performance, low resource consumption.
      • Excellent scaling capabilities, shared-nothing architecture.
    • “ When it comes to the Web and Web applications, Java is not the right language. PHP is to 2005 what Java was to 1995.”, Marc Andreessen, founder of Netscape Inc.
    PHP
    • Language Features
      • Supports both the procedural and object-oriented programming paradigms. Mixing them is possible and encouraged.
      • Feature-rich, class-based object model.
      • Native support for XML and other Web technologies.
    • Interpreter designed for extensibility.
    • Increasingly used outside its original Web context (CLI, Gtk+, Qt).
    PHP
  2. Example of PHP Base Code
  3. GAP
    • G eneric A spects for P HP.
      • Generic Join Point model for PHP.
        • Framework to implement custom pointcut system.
      • Aspect Generic ity.
    • Advice = Plain PHP method.
      • Inside this method, the same information is available that is used by GAP for advice dispatching.
    • Sample pointcut system uses annotations in code comments to connect join points to aspect effects .
  4. GAP
    • Join Points
      • Object Initialization
      • Field Access
      • Method Call / Method Execution
    • Aspect Effects
      • Advice
      • Intertype-Declarations
      • Custom Errors
  5. GAP
    • Sample Pointcut System
      • initialization( class ( parameters ))
      • get( modifier class -> attribute )
      • set( modifier class -> attribute )
      • method( modifier class -> method ( parameters ))
      • source( modifier class -> method ( parameters ))
      • cflow( modifier class -> method ( parameters ))
  6. A GAP Aspect
  7. A GAP Aspect
  8. Generic Aspects
    • Aspect languages introduce strong dependencies of aspect code on base code.
      • The use of concrete names of base code entities in pointcut expressions is required.
    • Wildcards such as * and .. are intended to alleviate this problem but are too general.
      • They match more than intended because it is not possible to express dependencies of the values matched by different wildcards.
  9. Generic Aspects
    • Generic aspect languages such as LogicAJ replace wildcards (e.g. * ) by named logic meta-variables (e.g. ?var ).
      • All occurrences of ?var in a pointcut expression must match the same value.
      • Further constraints on the legal matches can be expressed by additional predicates that can be used in pointcut definitions.
  10. A Generic GAP Aspect
  11. Existing AOP Solutions for PHP
    • Preprocessor
      • PHPAspect, AOPHP
    • Aspect-Aware PHP Interpreter
      • aspectPHP
    • Meta-Programming
      • AOP Library for PHP
    • Dependency Injection Container
      • Seasar2
  12. Implementation of GAP
    • Uses PHP's streams system and Runkit extension to
      • introduce generic hooks and
      • weave inter-type declarations
    • into PHP bytecode at load-time.
    • Generic hooks activate advice at runtime.
  13. Implementation of GAP Class Sources Aspect Sources Interception of loaded PHP source Source-Level Transformation Normal Compilation
  14. Implementation of GAP Bytecode-Level Transformation
  15. Conclusion
    • GAP
      • Implementation of aspect-oriented programming for PHP.
      • Uses dynamic weaving
      • Supports aspect genericity.
      • Provides a framework to implement custom pointcut languages on top of it.

+ Sebastian BergmannSebastian Bergmann, 4 years ago

custom

1661 views, 1 favs, 2 embeds more stats

Early Paper Presentation at the 3rd European Worksh more

More info about this document

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Go to text version

  • Total Views 1661
    • 1659 on SlideShare
    • 2 from embeds
  • Comments 1
  • Favorites 1
  • Downloads 0
Most viewed embeds
  • 1 views on http://www.yookoala.idv.hk
  • 1 views on http://www.cleeki.com

more

All embeds
  • 1 views on http://www.yookoala.idv.hk
  • 1 views on http://www.cleeki.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories