Buscar en Mind w/o Soul

lunes, septiembre 03, 2007

Ejemplo de Programación Orientada a Aspectos

Un ejemplo de cómo refactorizar un programa mediante Programación Orientada a Aspectos en Java con Eclipse. Video webcast.

AJDT Demos

Demonstration: Developing with AspectJ and AJDT

This demonstration shows the use of AspectJ and AJDT to
refactor a crosscutting concern (view notification) in a simple
insurance application. The demo is about 18MB in size (split
into four parts), and includes an audio commentary.

  • In part 1, we introduce the insurance
    application and show you how to
    convert an existing Java project in the Eclipse workspace to an
    AspectJ project. We also demonstrate how to create a new aspect using
    the New Aspect Wizard.

  • In part 2, we show how to use the
    declare warning
    construct to find all the places in the Insurance application
    concerned with view notification.

  • In part 3, the implementation of view
    notification is modularized
    in the aspect, and we show you how to use the AspectJ Development
    Tools (AJDT) to navigate around the structure of the program.

  • In part 4, we complete the
    implementation by ensuring that the
    test suite still passes, and leave behind a guard so that the
    modular implementation of view notification we just put in place
    cannot be accidently comprised by subsequent program maintenance.

No hay comentarios: