Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Due at Thursday, December 17th, 11:00 am (before the lecture starts) |
---|
5 points |
---|
You can find the sourcecode for this assignment in the project A07T17_UntanglingBanking. 'BankSession' in the folder 'tangled' contains the example for tangled code from the lecture. 'untangled' contains already a new untangeld version with aspects. Sadly the aspects still need to be implemented. Your task is to restore the functionality found in the tangled example code. Don't change anything except for the aspects. Make sure the test runs.
Implement the aspects ContractChecking
, Security
Logging
and Transactionality
.
The aspect ContractChecking
should contain all functionality that checks the input arguments, the supposed content of the aspects Security
, Logging
and Transactionality
should be obvious.
If you are unsure about what code in the tangled application matches what concern take a look at the lecture slides (slide 20,21).
3 points |
---|
Check out the project A07T18_RefactoringExercise. Your task is to de-scatter another banking example. Extract the permission checking (the calls to AccessController.checkPermission(..)
) into an aspect. Don’t forget to run the JUnit-tests after each step.
Before you can run the tests you will have to adapt the banking.policy file as described in notes.jpage
.1)
It should be possible to solve this just ad-hoc. If someone wants to learn a systematic way of doing this refactoring, she might want to read slide 15 and following of the refactoring class of the AOSD lecture, or the original article by Ramnivas Laddad on which the lecture is based.
4 points |
---|
In this task you will introduce RMI-based distribution to the banking example. If you are completely new to RMI have at look at a RMI tutorial first.
The base code is not distributed, yet. We already anticipated that a distributed object must always be accessed via an interface and
all methods in the interface must throw the checked exception RemoteException
, see hotel.control.ReservationHandler.
Your task is to complete the aspect hotel.control.Distribution which should:
Remote
and Serializable
to the ReserverationHandler
interface, see the AspectJ Quick Reference how this can be done (declare parents ..
).hotel.control.StartTestServer
class, which is responsible for registering a remote reservation object.2)ReserverationHandler
with a remote object. Hint: You can look up RMI object directly from the Registry, e.g. Registry registry = LocateRegistry.getRegistry(); return (ReservationHandler) registry.lookup("<registered name>");