Aspect-Oriented Web Development in 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.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Event

    Aspect-Oriented Web Development in PHP - Presentation Transcript

    1. “ Aspect-Oriented Web Development in PHP” Jorge Esparteiro Garcia February , 8 th 2008
    2. Agenda
      • Introduction
      • Motivation
      • Aspect Oriented Programming
        • Web Development
      • PHP Web Development
      • Aspect Oriented PHP Development Tools
      • Comparison of the Tools
      • Conclusions
      • Future Work
    3. Introduction
      • Growing Number of Web applications
      • Web applications more complex
        • Harder to separate Independent concerns
      • Aspect Oriented Programming better separate concerns than previous methodologies
        • Provides Modularization of crosscutting concerns
        • Reduce time and complexity of applications
    4. Motivation
      • AOP can be used with common object oriented language
        • Much of research on developing standalone applications
        • Less applied to Web development.
      • Web development can be improved using aspect-oriented techniques.
      • Developing AOP Web application using PHP – most used programming language.
      • We believe Web development can be improved using AO techniques.
    5. Aspect Oriented Programming (AOP)
      • New technology for separating concerns into single units: Aspects
      • Aspect : Modular unit of crosscutting implementation
      • Encapsulates behaviors that affect multiple classes into reusable modules.
    6. Aspect Oriented Programming (AOP)
      • AOP weaving process
        • Programming in our native OO language
        • Deal separately with crosscutting concerns by implementing aspects
        • Code and aspects are combined into a final executable using an aspect weaver
      • The original code doesn't need to know about any functionality the aspect has added
        • it only needs to be recompiled without the aspect to regain the original functionality.
    7. Aspect Oriented Programming (AOP)
      • Weaving Process
    8. AOP Web Development
      • Concerns on Web Development
        • Security
          • Authentication
        • Design by Contract
          • Conditions fulfilled before executing a method
          • Some programming languages use the notion of assertion
        • Exception Handling
          • Notification Policy
    9. AOP Web Development
      • Concerns on Web Development (cont.)
        • Logging
          • Logger Behavior – Messages printed out when certain points are reached in the execution of the program
        • Profiling
          • Measures time consumed in some methods. Helpful for detecting bottlenecks.
        • Pooling
          • Strategy to obtain faster database connections. Maintained a pool of connections and resources
    10. AOP Web Development
      • Concerns on Web Development (cont.)
        • Caching
          • Retention of data to minimize network traffic flow and/or disk accesses.
      • Crucial concerns in the development of a web application:
        • Pooling
        • Caching
        • Security
    11. PHP Web Development
      • Most popular server-side scripting systems on the web
      • Loose language – dynamically typed
      • Simplicity
        • Shorter development cycles
        • Easier maintenance
        • Lower training costs
      • Native support for XML and other Web technologies.
    12. Aspect Oriented PHP development tools
      • We consider two main methods of the extensions to support AOP in PHP
        • Preprocessing weaving
          • A preprocessor is used to perform source code transformations and carry the weaving process. Then the source code is produced
        • Runtime Weaving
          • No previous code generation – The weaving process in done dynamically
    13. Aspect Oriented PHP development tools
      • Preprocessing weaving method tools (1)
        • PHPAspect
          • Based on Lex and Yacc analysis to generate xml parse trees.
          • XSLT is used to perform the source code transformation on those trees.
          • Contains all the "traditionnals" joinpoints.
    14. Aspect Oriented PHP development tools
      • PHPAspect Weaving Chain
    15. Aspect Oriented PHP development tools
      • Preprocessing weaving method tools (2)
        • Aspect-Oriented PHP(aoPHP)
          • Uses a preprocessor for the PHP programming language written in Java
          • This preprocessor is responsible for the weaving process of the aspects and the base-code.
          • aoPHP contains support to the methods: execution/call, field read and write, among others.
          • Very Simple implementation
    16. Aspect Oriented PHP development tools
      • Runtime Weaving (1)
        • aspectPHP
          • Works in application runtime, taking advantage of the interpreted nature of the PHP language.
          • A first version of this tool was adapted from aoPHP implementation
          • Assumed all the aspects are already located in the same directory, as separate files "*.aspect".
          • The aspects are then loaded in sequence by the weaver, to weave them with the original code.
    17. Aspect Oriented PHP development tools
      • Runtime Weaving (2)
        • GAP: Generic Aspects for PHP
          • First implementation that supports dynamic weaving, genericity and an extensible pointcut language.
          • Uses the PHP Runkit extension
          • Definition of aspects is obtained through the creation of classes.
          • The creation of pointcuts and association of advice to the joint points is carried through with the aid of annotations - Precedes the class definition.
    18. Aspect Oriented PHP development tools
      • The weaving chain of GAP
    19. Comparison of the tools
      • Preprocessing weaving tools
        • Advantages
          • Adds the possibility of using AOP paradigm applied on the PHP Web Development
        • Disadvantages
          • Preprocessing adds an extra step to the development of a PHP Web application.
          • Need of extra compilers and preprocessors on the server
          • The generated code won´t run natively on any PHP interpreter
          • Increases Development time
    20. Comparison of the tools
      • Runtime weaving tools
        • Advantages
          • No preprocessing – The weaving process in done dynamically
          • No need of extra compilers or preprocessors line preprocessing
          • Apply aspects selectively in runtime
          • Interpretative nature of PHP persists.
        • Disadvantages
          • Slower than preprocessing - Manage runtime aspects
          • Do not implement the new language constructs
    21. Conclusions
      • AOP can modularize crosscutting concerns in Web Applications.
      • Little AOP research on Web development.
      • All AOP PHP tools are on a very early stage of development.
      • GAP – Generic Aspects is the most promising tool
        • No development since 2006
      • Runtime Weaving can be very interesting applied to Web Development
        • Apply aspects in runtime without preprocessing
      • Suitable for the crosscutting concerns: security, pooling and caching.
    22. Future Work
      • Deeper research to find and treat properly specific web concerns.
      • Classification of the concerns for the success of a web application.
      • Use the knowledge acquired on this work to develop a new AOP PHP implementation
      • Thanks for your attention! Questions?

    + fcorreiafcorreia, 2 years ago

    custom

    729 views, 0 favs, 0 embeds more stats

    Presented on DSIE'08 - http://www.fe.up.pt/dsie08

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 729
      • 729 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 11
    Most viewed embeds

    more

    All embeds

    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

    Groups / Events