diff --git a/lab10/GumballMachineV1/.classpath b/lab10/GumballMachineV1/.classpath new file mode 100644 index 0000000..3f59c03 --- /dev/null +++ b/lab10/GumballMachineV1/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/lab10/GumballMachineV1/.project b/lab10/GumballMachineV1/.project new file mode 100644 index 0000000..5e5600a --- /dev/null +++ b/lab10/GumballMachineV1/.project @@ -0,0 +1,40 @@ + + + GumballMachineV1 + + + + + + de.ovgu.featureide.core.extensibleFeatureProjectBuilder + + + build + src + + + composer + de.ovgu.featureide.core.composer.aspectj + + + equations + configs + + + source + src + + + + + org.eclipse.ajdt.core.ajbuilder + + + + + + org.eclipse.ajdt.ui.ajnature + org.eclipse.jdt.core.javanature + de.ovgu.featureide.core.featureProjectNature + + diff --git a/lab10/GumballMachineV1/configs/default.config b/lab10/GumballMachineV1/configs/default.config new file mode 100644 index 0000000..5e01bd5 --- /dev/null +++ b/lab10/GumballMachineV1/configs/default.config @@ -0,0 +1 @@ +QTR25 diff --git a/lab10/GumballMachineV1/model.xml b/lab10/GumballMachineV1/model.xml new file mode 100644 index 0000000..774fc03 --- /dev/null +++ b/lab10/GumballMachineV1/model.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lab10/GumballMachineV1/src/COINS50.aj b/lab10/GumballMachineV1/src/COINS50.aj new file mode 100644 index 0000000..a480321 --- /dev/null +++ b/lab10/GumballMachineV1/src/COINS50.aj @@ -0,0 +1,47 @@ + +public aspect COINS50 { + + // implement advice for getTenant + Object around(GumballMachine m) : target(m) && call(String GumballMachine.getTenant(..)) { + return "COINS50" ; + } + + // implement advice for insertQuarter + after(GumballMachine m): target(m) && call(void GumballMachine.insertQuarter(..)) { + if (m.getCoinValue() < 50) { + m.setCoinValue(m.getCoinValue() + 25); + System.out.println("A quarter has been inserted"); + } else { + System.out.println("There are already quarters in the slot"); + } + } + + + // implement advice for insertCoin + after(GumballMachine m): target(m) && call(void GumballMachine.insertCoin(..)) { + Object[] args = thisJoinPoint.getArgs(); + int value = ((Integer) args[0]).intValue() ; + if (m.getCoinValue() < 50) { + m.setCoinValue(m.getCoinValue() + value); + System.out.println( value + " cents has been inserted"); + } else { + System.out.println("There are already 50 cents in the slot"); + } + } + + // implement advice for turnTheCrank + after(GumballMachine m): target(m) && call(void GumballMachine.turnTheCrank(..)) { + if (m.getCoinValue() == 50) { + m.setCoinValue(0); + if (m.getCount() > 0) { + System.out.println("Here is your Gumball! Enjoy!"); + m.setCount(m.getCount() - 1); + } else { + System.out.println("Sorry! We're out of Gumballs!"); + } + } else { + System.out.println("Crank will not turn without enough Coins!"); + } + } + +} \ No newline at end of file diff --git a/lab10/GumballMachineV1/src/GumballMachine.java b/lab10/GumballMachineV1/src/GumballMachine.java new file mode 100644 index 0000000..bb75335 --- /dev/null +++ b/lab10/GumballMachineV1/src/GumballMachine.java @@ -0,0 +1,68 @@ +public class GumballMachine { + + private int cnt = 0; + private boolean quarterInSlot = false; + private int coinValue = 0; + + public String getTenant() { + return null ; + } + + public int getCoinValue() { + return coinValue; + } + + public void setCoinValue(int v) { + this.coinValue = v; + } + + public boolean isQuarterInSlot() { + return quarterInSlot; + } + + public void setQuarterInSlot(boolean q) { + this.quarterInSlot = q; + } + + public GumballMachine(int count) { + this.cnt = count; + } + + public void insertQuarter() { + System.out.println( "==> Insert Quarter <==" ) ; + } + + public void insertCoin(Integer value) { + System.out.println( "==> Insert Coin " + value.toString() + " <==" ) ; + } + + public void turnTheCrank() { + System.out.println( "==> Turn Crank <==" ) ; + } + + public int getCount() { + return cnt; + } + + public void setCount(int c) { + cnt = c; + } + + public static void main(String[] args) { + GumballMachine m = new GumballMachine(2); + System.out.println("*** Gumball Machine " + m.getTenant() + " *** "); + m.insertQuarter(); + m.turnTheCrank(); // should eject for tenant #1 + m.insertQuarter(); + m.turnTheCrank(); // should eject for tenant #1, #2, and #3 + m.insertCoin(10); + m.insertCoin(10); + m.insertCoin(5); + m.insertCoin(25); + m.turnTheCrank(); // should eject for tenant #3 + m.insertCoin(10); + m.insertCoin(10); + m.turnTheCrank(); // should eject for tenant #3 + } + +} diff --git a/lab10/GumballMachineV1/src/QTR25.aj b/lab10/GumballMachineV1/src/QTR25.aj new file mode 100644 index 0000000..349749f --- /dev/null +++ b/lab10/GumballMachineV1/src/QTR25.aj @@ -0,0 +1,33 @@ +public aspect QTR25 { + + // implement advice for getTenant + Object around(GumballMachine m) : target(m) && call(String GumballMachine.getTenant(..)) { + return "QTR25" ; + } + + // implement advice for insertQuarter + after(GumballMachine m): target(m) && call(void GumballMachine.insertQuarter(..)) { + if ( !m.isQuarterInSlot() ) { + m.setQuarterInSlot( true ); + System.out.println("A quarter has been inserted"); + } else { + System.out.println("There's already a quarter in the slot"); + } + } + + // implement advice for turnTheCrank + after(GumballMachine m): target(m) && call(void GumballMachine.turnTheCrank(..)) { + if (m.isQuarterInSlot()) { + m.setQuarterInSlot( false ) ; + if (m.getCount() > 0) { + System.out.println("Here is your Gumball! Enjoy!"); + m.setCount(m.getCount()-1); + } else { + System.out.println("Sorry! We're out of Gumballs!"); + } + } else { + System.out.println("Crank will not turn without a Quarter!"); + } + } + +} \ No newline at end of file diff --git a/lab10/GumballMachineV1/src/QTR50.aj b/lab10/GumballMachineV1/src/QTR50.aj new file mode 100644 index 0000000..f1eb53c --- /dev/null +++ b/lab10/GumballMachineV1/src/QTR50.aj @@ -0,0 +1,33 @@ +public aspect QTR50 { + + // implement advice for getTenant + Object around(GumballMachine m) : target(m) && call(String GumballMachine.getTenant(..)) { + return "QTR50" ; + } + + // implement advice for insertQuarter + after(GumballMachine m): target(m) && call(void GumballMachine.insertQuarter(..)) { + if (m.getCoinValue() < 50) { + m.setCoinValue(m.getCoinValue() + 25); + System.out.println("A quarter has been inserted"); + } else { + System.out.println("There are already quarters in the slot"); + } + } + + // implement advice for turnTheCrank + after(GumballMachine m): target(m) && call(void GumballMachine.turnTheCrank(..)) { + if (m.getCoinValue() == 50) { + m.setCoinValue(0); + if (m.getCount() > 0) { + System.out.println("Here is your Gumball! Enjoy!"); + m.setCount(m.getCount() - 1); + } else { + System.out.println("Sorry! We're out of Gumballs!"); + } + } else { + System.out.println("Crank will not turn without enough Quarters!"); + } + } + +} \ No newline at end of file diff --git a/lab10/GumballMachineV1_C25_Q25.png b/lab10/GumballMachineV1_C25_Q25.png new file mode 100644 index 0000000..721f31b Binary files /dev/null and b/lab10/GumballMachineV1_C25_Q25.png differ diff --git a/lab10/GumballMachineV1_C50_COINS50.png b/lab10/GumballMachineV1_C50_COINS50.png new file mode 100644 index 0000000..e4c1345 Binary files /dev/null and b/lab10/GumballMachineV1_C50_COINS50.png differ diff --git a/lab10/GumballMachineV1_C50_QTR50.png b/lab10/GumballMachineV1_C50_QTR50.png new file mode 100644 index 0000000..190697a Binary files /dev/null and b/lab10/GumballMachineV1_C50_QTR50.png differ diff --git a/lab10/GumballMachineV2/.classpath b/lab10/GumballMachineV2/.classpath new file mode 100644 index 0000000..0bd3590 --- /dev/null +++ b/lab10/GumballMachineV2/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/lab10/GumballMachineV2/.project b/lab10/GumballMachineV2/.project new file mode 100644 index 0000000..dbcb3b6 --- /dev/null +++ b/lab10/GumballMachineV2/.project @@ -0,0 +1,40 @@ + + + GumballMachineV2 + + + + + + de.ovgu.featureide.core.extensibleFeatureProjectBuilder + + + build + src + + + composer + de.ovgu.featureide.core.composer.aspectj + + + equations + configs + + + source + src + + + + + org.eclipse.ajdt.core.ajbuilder + + + + + + org.eclipse.ajdt.ui.ajnature + org.eclipse.jdt.core.javanature + de.ovgu.featureide.core.featureProjectNature + + diff --git a/lab10/GumballMachineV2/configs/default.config b/lab10/GumballMachineV2/configs/default.config new file mode 100644 index 0000000..cea5c56 --- /dev/null +++ b/lab10/GumballMachineV2/configs/default.config @@ -0,0 +1,2 @@ +SLOTMODEL +COST50 diff --git a/lab10/GumballMachineV2/model.xml b/lab10/GumballMachineV2/model.xml new file mode 100644 index 0000000..bb39f14 --- /dev/null +++ b/lab10/GumballMachineV2/model.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ONEQTR + COST25 + + + + + TWOQTR + COST50 + + + + + + + diff --git a/lab10/GumballMachineV2/src/COST25.aj b/lab10/GumballMachineV2/src/COST25.aj new file mode 100644 index 0000000..d39d7ff --- /dev/null +++ b/lab10/GumballMachineV2/src/COST25.aj @@ -0,0 +1,9 @@ + +public privileged aspect COST25 { + + // Initialize Cost of Gumball + after() returning(GumballMachine m) : call(GumballMachine.new(..)) { + m.setCost(25) ; + } + +} \ No newline at end of file diff --git a/lab10/GumballMachineV2/src/COST50.aj b/lab10/GumballMachineV2/src/COST50.aj new file mode 100644 index 0000000..16d0fa1 --- /dev/null +++ b/lab10/GumballMachineV2/src/COST50.aj @@ -0,0 +1,10 @@ + +public privileged aspect COST50 { + + // Initialize Cost of Gumball + after() returning(GumballMachine m) : call(GumballMachine.new(..)) { + m.setCost(50) ; + } + + +} \ No newline at end of file diff --git a/lab10/GumballMachineV2/src/CRANKMODEL.aj b/lab10/GumballMachineV2/src/CRANKMODEL.aj new file mode 100644 index 0000000..110ddce --- /dev/null +++ b/lab10/GumballMachineV2/src/CRANKMODEL.aj @@ -0,0 +1,34 @@ + +public privileged aspect CRANKMODEL { + + // Declarations + declare parents: GumballMachine implements IGumballMachineCrank; + + // Insert Quarter Introduction + public void GumballMachine.insertQuarter() { + System.out.println("=> Insert Quarter...") ; + insertCoinValue( 25 ) ; + } + + // Turn Crank Introduction + public void GumballMachine.turnTheCrank() { + System.out.println("=> Turn The Crank...") ; + ejectGumball() ; + } + + // Test + after() : execution(static * *.main(..) ) { + System.out.println( "\n\n***** Gumball Machine Crank Model 2.0 *****\n\n" ) ; + GumballMachine m = new GumballMachine(10) ; + m.dumpConfig() ; + m.insertQuarter() ; + m.turnTheCrank() ; + m.insertQuarter() ; + m.turnTheCrank() ; + m.insertQuarter() ; + m.insertQuarter() ; + m.turnTheCrank() ; + m.dumpConfig() ; + } + +} diff --git a/lab10/GumballMachineV2/src/GumballMachine.java b/lab10/GumballMachineV2/src/GumballMachine.java new file mode 100644 index 0000000..fa2f268 --- /dev/null +++ b/lab10/GumballMachineV2/src/GumballMachine.java @@ -0,0 +1,79 @@ + + +import java.lang.reflect.* ; + +public class GumballMachine { + + private int cnt = 0; // inventory + private int coinValue = 0 ; // cents + private int cost = 0 ; // configure at setup + + public GumballMachine(int count) { + this.cnt = count; + } + + // Display Config + public void dumpConfig() { + System.out.println( "Gumball Inventory: " + cnt ) ; + System.out.println( "Gumball Cost: " + cost ) ; + System.out.println( "Coin Value: " + coinValue ) ; + } + + // Coin Property + private void setCoinValue( int v ) { + if ( (coinValue) > cost ) { + System.out.println( "There's already enough money!" ) ; + } + else { + coinValue = v ; + } + } + private int getCoinValue() { return coinValue ; } + + // Configure Cost of a Gumball + private void setCost( int c ) { cost = c ; } + private int getCost() { return cost ; } + + + // Insert Coin Helper Method + private void insertCoinValue( int v ) { + System.out.println( "Added " + v + " cents...") ; + setCoinValue(coinValue + v) ; + } + + // Eject Gumball if Available + private void ejectGumball() { + if ( coinValue < cost ) { + System.out.println( "Not Enough Money!" ) ; + return ; + } + if ( cnt > 0 ) { + cnt-- ; + System.out.println( "Gumball Ejected!" ) ; + System.out.println( "Change Return: " + (coinValue - cost) + " cents." ) ; + coinValue = 0 ; + } + else { + System.out.println( "Sorry! Out of Gumballs." ) ; + } + } + + // Main Class - Dump Metadata + public static void main( String args[ ] ) + { + + System.out.println( "***** Class Bytecode Dump *****" ) ; + GumballMachine m = new GumballMachine(10) ; + Class gmClass = m.getClass() ; + Method gmMethods[] = gmClass.getMethods() ; + for ( int i=0; i = 25 ) { + System.out.println( "Machine only accepts one Quarter!" ) ; + } + else { + proceed(m); + } + } + + + +} + diff --git a/lab10/GumballMachineV2/src/SLOTMODEL.aj b/lab10/GumballMachineV2/src/SLOTMODEL.aj new file mode 100644 index 0000000..ca6fd8f --- /dev/null +++ b/lab10/GumballMachineV2/src/SLOTMODEL.aj @@ -0,0 +1,41 @@ + + +public privileged aspect SLOTMODEL { + + // Declarations + declare parents: GumballMachine implements IGumballMachineSlot; + + // Insert Quarter Introduction + public void GumballMachine.insertCoin(int value) { + System.out.println("=> Insert Coin: " + value + " cents"); + insertCoinValue(value); + if (coinValue >= cost) + ejectGumball(); + } + + // Turn Crank Introduction + public void GumballMachine.returnCoins() { + System.out.println("=> Return Coins..."); + System.out.println( "Change Return: " + coinValue + " cents." ) ; + setCoinValue( 0 ) ; + } + + // Test + after() : execution(static * *.main(..) ) { + System.out.println("\n\n***** Gumball Machine Slot Model 2.0 *****\n\n"); + GumballMachine m = new GumballMachine(10); + m.dumpConfig(); + m.insertCoin(10) ; + m.insertCoin(5); + m.returnCoins(); // return 15 cents change + m.insertCoin(50) ; // ejects gumball + m.insertCoin(100) ; // ejects gumball + 50 cents change + m.insertCoin(25) ; + m.insertCoin(10) ; + m.insertCoin(5) ; + m.insertCoin(10) ; // ejects gumball + m.dumpConfig() ; + + } + +} diff --git a/lab10/GumballMachineV2/src/TWOQTR.aj b/lab10/GumballMachineV2/src/TWOQTR.aj new file mode 100644 index 0000000..ad1df4e --- /dev/null +++ b/lab10/GumballMachineV2/src/TWOQTR.aj @@ -0,0 +1,18 @@ + +public privileged aspect TWOQTR { + + // PointCut + void around(GumballMachine m) : target(m) && execution(void GumballMachine.insertQuarter(..)) + { + int val = m.getCoinValue() ; + if ( val >= 50 ) { + System.out.println( "Machine accepts two Quarters!" ) ; + } + else { + proceed(m); + } + } + + + +} \ No newline at end of file diff --git a/lab10/GumballMachineV2_CRANKMODEL_ONEQTR_COST25.png b/lab10/GumballMachineV2_CRANKMODEL_ONEQTR_COST25.png new file mode 100644 index 0000000..7c0c213 Binary files /dev/null and b/lab10/GumballMachineV2_CRANKMODEL_ONEQTR_COST25.png differ diff --git a/lab10/GumballMachineV2_CRANKMODEL_TWOQTR_COST50.png b/lab10/GumballMachineV2_CRANKMODEL_TWOQTR_COST50.png new file mode 100644 index 0000000..10e5bfc Binary files /dev/null and b/lab10/GumballMachineV2_CRANKMODEL_TWOQTR_COST50.png differ diff --git a/lab10/GumballMachineV2_SLOTMODEL_COST25.png b/lab10/GumballMachineV2_SLOTMODEL_COST25.png new file mode 100644 index 0000000..b1ec1b7 Binary files /dev/null and b/lab10/GumballMachineV2_SLOTMODEL_COST25.png differ diff --git a/lab10/GumballMachineV2_SLOTMODEL_COST50.png b/lab10/GumballMachineV2_SLOTMODEL_COST50.png new file mode 100644 index 0000000..179b322 Binary files /dev/null and b/lab10/GumballMachineV2_SLOTMODEL_COST50.png differ diff --git a/lab10/HelloWorld-AspectJ/.classpath b/lab10/HelloWorld-AspectJ/.classpath new file mode 100644 index 0000000..4aaad17 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/lab10/HelloWorld-AspectJ/.project b/lab10/HelloWorld-AspectJ/.project new file mode 100644 index 0000000..25413d7 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/.project @@ -0,0 +1,44 @@ + + + HelloWorld-AspectJ + + [description] + This is a simple hello world application for Aspect-J. + [/description] + + + + + + de.ovgu.featureide.core.extensibleFeatureProjectBuilder + + + build + src + + + composer + de.ovgu.featureide.core.composer.aspectj + + + equations + configs + + + source + src + + + + + org.eclipse.ajdt.core.ajbuilder + + + + + + org.eclipse.ajdt.ui.ajnature + org.eclipse.jdt.core.javanature + de.ovgu.featureide.core.featureProjectNature + + diff --git a/lab10/HelloWorld-AspectJ/configs/BeautifulWorld.xml b/lab10/HelloWorld-AspectJ/configs/BeautifulWorld.xml new file mode 100644 index 0000000..5721d3a --- /dev/null +++ b/lab10/HelloWorld-AspectJ/configs/BeautifulWorld.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/lab10/HelloWorld-AspectJ/configs/Hello.xml b/lab10/HelloWorld-AspectJ/configs/Hello.xml new file mode 100644 index 0000000..ca35098 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/configs/Hello.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/lab10/HelloWorld-AspectJ/configs/HelloWorld.xml b/lab10/HelloWorld-AspectJ/configs/HelloWorld.xml new file mode 100644 index 0000000..9b5a919 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/configs/HelloWorld.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/lab10/HelloWorld-AspectJ/configs/WonderfulWorld.xml b/lab10/HelloWorld-AspectJ/configs/WonderfulWorld.xml new file mode 100644 index 0000000..f8941e1 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/configs/WonderfulWorld.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/lab10/HelloWorld-AspectJ/model.xml b/lab10/HelloWorld-AspectJ/model.xml new file mode 100644 index 0000000..cda0e8f --- /dev/null +++ b/lab10/HelloWorld-AspectJ/model.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + Feature + World + + + + + + + diff --git a/lab10/HelloWorld-AspectJ/src/Beautiful.aj b/lab10/HelloWorld-AspectJ/src/Beautiful.aj new file mode 100644 index 0000000..462837f --- /dev/null +++ b/lab10/HelloWorld-AspectJ/src/Beautiful.aj @@ -0,0 +1,36 @@ +/* FeatureIDE - A Framework for Feature-Oriented Software Development + * Copyright (C) 2005-2017 FeatureIDE team, University of Magdeburg, Germany + * + * This file is part of FeatureIDE. + * + * FeatureIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FeatureIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with FeatureIDE. If not, see . + * + * See http://featureide.cs.ovgu.de/ for further information. + */ + +/** + * Hello World example for FeatureIDE projects using AspectJ for aspect-oriented + * programming. + * + * @author Thomas Thuem + */ +public aspect Beautiful { + + declare precedence: World, Beautiful; + + after(): execution(void Hello.print()) { + System.out.print(" beautiful"); + } + +} \ No newline at end of file diff --git a/lab10/HelloWorld-AspectJ/src/Hello.java b/lab10/HelloWorld-AspectJ/src/Hello.java new file mode 100644 index 0000000..15f5390 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/src/Hello.java @@ -0,0 +1,38 @@ +/* FeatureIDE - A Framework for Feature-Oriented Software Development + * Copyright (C) 2005-2017 FeatureIDE team, University of Magdeburg, Germany + * + * This file is part of FeatureIDE. + * + * FeatureIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FeatureIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with FeatureIDE. If not, see . + * + * See http://featureide.cs.ovgu.de/ for further information. + */ + +/** + * Hello World example for FeatureIDE projects using AspectJ for aspect-oriented + * programming. + * + * @author Thomas Thuem + */ +public class Hello { + + protected void print() { + System.out.print("Hello"); + } + + public static void main(String[] args) { + new Hello().print(); + } + +} \ No newline at end of file diff --git a/lab10/HelloWorld-AspectJ/src/Wonderful.aj b/lab10/HelloWorld-AspectJ/src/Wonderful.aj new file mode 100644 index 0000000..79ceb6a --- /dev/null +++ b/lab10/HelloWorld-AspectJ/src/Wonderful.aj @@ -0,0 +1,36 @@ +/* FeatureIDE - A Framework for Feature-Oriented Software Development + * Copyright (C) 2005-2017 FeatureIDE team, University of Magdeburg, Germany + * + * This file is part of FeatureIDE. + * + * FeatureIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FeatureIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with FeatureIDE. If not, see . + * + * See http://featureide.cs.ovgu.de/ for further information. + */ + +/** + * Hello World example for FeatureIDE projects using AspectJ for aspect-oriented + * programming. + * + * @author Thomas Thuem + */ +public aspect Wonderful { + + declare precedence: World, Wonderful; + + after(): execution(void Hello.print()) { + System.out.print(" wonderful"); + } + +} \ No newline at end of file diff --git a/lab10/HelloWorld-AspectJ/src/World.aj b/lab10/HelloWorld-AspectJ/src/World.aj new file mode 100644 index 0000000..0fca273 --- /dev/null +++ b/lab10/HelloWorld-AspectJ/src/World.aj @@ -0,0 +1,34 @@ +/* FeatureIDE - A Framework for Feature-Oriented Software Development + * Copyright (C) 2005-2017 FeatureIDE team, University of Magdeburg, Germany + * + * This file is part of FeatureIDE. + * + * FeatureIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FeatureIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with FeatureIDE. If not, see . + * + * See http://featureide.cs.ovgu.de/ for further information. + */ + +/** + * Hello World example for FeatureIDE projects using AspectJ for aspect-oriented + * programming. + * + * @author Thomas Thuem + */ +public aspect World { + + after(): execution(void Hello.print()) { + System.out.print(" world"); + } + +} \ No newline at end of file diff --git a/lab10/README.md b/lab10/README.md new file mode 100644 index 0000000..e69de29