SDSU CS 683 Emerging Technologies
Spring Semester, 2003
Assignment 1
    Assignment Index        
© 2003, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 21-Jan-03

Assignment 1

Due Tuesday January 28

1. Select which environment you are going to run AspectJ programs: AspectBrowser or Eclipse. Eclipse is strongly recommended. Run the two following programs in that environment. What do you have to do differently to run the second program?

Program 1
public class Hello
        {
        public static void main(String[] args )
                {
                System.out.println("Hello");
                }
        }

HelloAspect.java
public aspect HelloAspect
        {
        before() : call(static void main(String[]) )
                {
                        System.out.println( "Start");
                }
        }

Program 2
package example;
   
public class Hello
        {
        public static void main(String[] args )
                {
                System.out.println("Hello");
                }
        }
HelloAspect.java
public aspect HelloAspect
        {
        before() : call(static void main(String[]) )
                {
                        System.out.println( "Start");
                }
        }

2. What is the result of running the following system:

public class Hello
        {
        public static void main(String[] args )
                {
                System.out.println("Hello");
                }
        }
   
public aspect HelloAspect
   {
   void around(String[] input) : args(input) && call(void main(String[]) )
      {
         System.out.println( "Start");
         if (input.length > 0)
            proceed(input);
      }
   }


Copyright ©, All rights reserved.
2003 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

    visitors since 21-Jan-03