School of computer science and informatics, cardiff university



Download 174.27 Kb.
Page14/14
Date06.08.2017
Size174.27 Kb.
#28007
1   ...   6   7   8   9   10   11   12   13   14

Code Sources


[39] SpringUtilities.java [Online]. Available at: http://docs.oracle.com/javase/tutorial/uiswing/examples/layout/SpringGridProject/src/layout/SpringUtilities.java [Accessed: 25th May 2013]

[40] MySQL Connector JAR, Version 5. [Online] Available at: http://dev.mysql.com/downloads/connector/j/ [Accessed: 14th June 2013]


Tools


[41] Eclipse Kepler. [Online] Available at: http://www.eclipse.org/kepler/ [Accessed: July 2013]

[42] MySQL Workbench. [Online] Available at: http://www.mysql.com/products/workbench/ [Accessed: January 2013]


Bibliography


Textbooks, Journals and Papers

Abdelmoez, W. et al. “Comparing Maintainability Evolution of Object-Oriented and Aspect-Oriented Software Product Lines”. 8th International Conference on Informatics and Systems – 14-16 May, pp. 53-60.

Baca, P. and Vranic, V. 2011. “Replacing Object-Oriented Design Patterns with Intrinsic Aspect-Oriented Design Patterns”. 2nd Eastern European Regional Conference on the Engineering of Computer Based Systems, pp. 19-26.

Borgida, A. 1986. “Exceptions in Object-Oriented Languages”. ACM Sigplan Notices 21(10), pp. 107-119.

Ceccato, M. 2007. “Migrating Object Oriented Code to Aspect Oriented Programming”, IEEE Conference on Software Maintenance, ICSM 2007, pp. 497-498.

Ernst, E. and Lorenz, D.H. 2003. Aspects and Polymorphism in AspectJ. Proceedings of the 2nd international conference on Aspect-oriented software development, pp. 150-157. : ACM

Hannemann, J. and Kiczales G. 2002. “Design Pattern Implementation in Java and AspectJ”. OOPSLA. Seattle, Washington, USA, November 4-8, 2002.

Lippert, M. and Lopes, C.V. 2000. “A Study on Exception Detection and Handling Using Aspect-Oriented Programming”, pp. 418-427

Murphy, G.C. and Walker, R.J. 1999. “Evaluating Emerging Software Development Technologies: Lessons Learnt from Assessing Aspect-Oriented Programming”. IEEE Transactions on Software Engineering 25 (4), pp. 438-455

Nuseibeh, B. 2004. Crosscutting Requirements. Proceedings of the 3rd international conference on Aspect-oriented software development, pp. 3-4.

Shinomi, H. and Tamai, T. 2005. “Impact Analysis of Weaving in Aspect-Oriented Programming”. Proceedings of 21st IEEE International Conference on Software Maintenance.

Zhang, S. et al. 2008. “Change Impact Analysis for AspectJ Programs”, IEEE International Conference on Software Maintenance, ICSM 2008, pp. 87-96.


Appendix A: Java Test Plan for Graphical User Interface


Test Number

Test Name

Intended Result

Achieved?

1a

Valid Login Attempt

Prompt with confirmation, close login form and display main menu.



1b

Invalid Login Attempt

Prompt with error message, reset username and password fields.



2a

Displaying Customer Panel

The panel of the main window should change to one displaying customer details.



2b

Displaying Staff Panel

The panel of the main window should change to one displaying staff details.



2c

Displaying New Customer Form

The panel of the main window should change to one displaying a form for new customers.



3

Successful Enabling of Buttons

When a row is selected in a table, the button options available should be enabled.



4a

Refreshing Table

When the refresh button is clicked, the tables should refresh.



4b

Returning to Menu

When the menu button is clicked, the main menu should appear in the main window.



5a

Editing Popup

When the editing button is clicked, a dialog box for editing details should appear.



5b

Transaction Popup

When the add transaction button is clicked, a dialog box for adding a transaction should appear.



6a

Removal of Customer

After selecting the customer removal button, and clicking OK in the dialog box, with a confirmation message.



6b

Changing Decision of Removal

After selecting the customer removal button, and clicking Cancel in the dialog box, cancelling the action.



7

Change Staff Ranking

Alter the rank of a staff member to a lower level. The GUI should query an input from the user, and when refreshed the table should indicate the change.



8

Toggle Customer Button On/Off

On the new customer panel, when the account information button is clicked, the customer button should be disabled.



9

Logging Out

After clicking the logout button, the application closes.



10a

Regular Expression: Email

The given email address will be detected as valid by the associated regular expression.



10b

Regular Expression: Incorrect Email

The given email address will be detected as invalid by the associated regular expression.



11a

Regular Expression: Postcode

The given postcode will be detected as valid by the associated regular expression.



11b

Regular Expression: Incorrect Postcode

The given postcode will be detected as invalid by the associated regular expression.




Appendix B: AspectJ Test Plan


Test Number

Test Name

Intended Result

Achieved?

1

GUI Buttons

An additional button is added to the JPanel created.



2a

Validation Success

The aspect validates two parameters from the parameter,



2b

Validation Failure

The aspect validates a parameter, but the program indicates the parameter is set at the incorrect value.



3

Extension/Implementation

The aspect handles the implementation of the interface, no declaration in the child class.



4

Incorrect Constructor Call Location

The call to the constructor is detected, and the advice prints an error message to the output window.



5a

Exception – at Try-Catch Blocks

When a try-catch block is found, the aspect prints out the error message, with the block being blank.



5b

Exception – Without Try-Catch Blocks

The exception is captured by the aspect, displaying an error dialog box, without any try-catch block.



5c

Exception – Softening Exceptions

The exception is softened by the aspect, when it’s not a runtime exception, without the need for try-catch.



6

Inter-Type Declaration

The original class is extended by the aspect after creation, adding an additional integer field of value 5.



7

Logging

The logging message inside the aspect appears in the log file correctly.




Appendix C: Relational Database Model Diagram



Appendix D: AOP and AspectJ Questionnaire and Solutions


1. Having read the appendix provided, what is your initial thought on AOP and do you think it would be useful (and what for)?

2. Have you used AOP before, and if so what was your experience like?

3. Describe what you think the following pointcuts do, in as much detail as possible.

A.

pointcut method1(ActionEvent e, MainListener m) :



execution(void MainListener.actionPerformed(ActionEvent))

&& args(e) && this(m);



Solution:

This pointcut detects when the body of the actionPerformed method within MainListener is executed, with a given ActionEvent argument, and the instance of MainListener containing the execution is captured. This is taken from the “Refresh” aspect.

B.

pointcut method2() : call(SQLConnect.new(..)) && !within(Constants);



Solution:

This pointcut detects a call to the SQLConnect constructor, without considering the arguments, and when the call is made in a class other than Constants. This is taken from the “NotThis” aspect.

4. Identify and list the classes and methods involved in adding a transaction, in the Java system.



Solution:

Ignoring the login system, the control flow goes through these classes:

MenuPanel -> MainListener -> CustomerPanel -> MainListener -> TransactionFrame -> TransactionListener -> TransactionSQL -> MainListener

5. Identify and list the classes and methods involved in adding a transaction in the AspectJ system. What is the crosscutting concern and what file is it in?



Solution:

The control flow is similar to the Java version, however before reaching the executeQuery method for transactions in TransactionSQL, the “Validation” aspect advises before advice to validate the inputs. Additional credit would be for recognising the “Commit” aspect with rollback protection.

6. Any general comments on your experience with questions 4 and 5?

7. Do you think, after looking at the AspectJ code, that AOP would be useful, and why?

8. Give one potential benefit and one potential disadvantage of using AOP, in your opinion.


Appendix E: UML Diagrams


Figure : UML Activity Diagram for Editing Details



Figure : UML Activity Diagram for Transactions



Figure : UML Activity Diagram for Removal of Customers/Staff



Figure : UML Activity Diagram for SQL Communication



Figure : UML Class Diagram


Appendix F: GUI Mockups


Both original paper, and computer drawings, of GUI designs are listed below.





Figure : GUI Mockup for Login Screen





Figure : GUI Mockup of Main Menu





Figure : GUI Mockup of Transaction Form

Appendix G: Source Code Running Instructions


A zip file has been included with this submission, providing the source code for the two systems developed for the practical assessment. Unit test files are also included. This appendix details its contents and gives running instructions.

Source Code

In the “Source” folder, you will find the .java and .aj files for each version respectively, and can be viewed using a standard text editor.



Eclipse Project Files

In addition to the source code, project files are included to allow the code to be easily transferred into Eclipse, in the “Projects” folder. Simply import the project using “File…Import”, select “Existing Projects in Workspace”, and browse to the correct folder:



  • MSc – Java

  • MSc – AspectJ

Running the AspectJ version in Eclipse will require an additional plugin:

  • Go to “Help…Install New Software”

  • In the “Work with…” input, paste http://download.eclipse.org/tools/ajdt/43/update

  • Select all the downloads, and then follow the on-screen instructions

  • Then follow the same import process as the Java version

The JAR file for SQL connections is also included. Please ensure this is in the Java build path for both projects.

Executable JAR Files

The following are executable JAR files, just double-click on their icon or run from the command line.



  • javaVersion

  • aspectJVersion

Both will create a text file for logging purposes when opened.

1 More information on object-oriented programming is provided from page 12.

2 Discussed in more detail in the “Current Status” section (p10)

3 www.hkbu.edu.hk/~shtong/tim.doc - Hong Kong Baptist University

4 Analysis of research material can be found in “Critical Analysis of Research Material” (p15)

5 The hypothesis can be read in the “Aims and Objectives” section (p6).

6 More information can be found at the Princeton University website, http://sip.cs.princeton.edu/projects/aspectml/


Download 174.27 Kb.

Share with your friends:
1   ...   6   7   8   9   10   11   12   13   14




The database is protected by copyright ©ininet.org 2024
send message

    Main page