Comp 667 - 001				110236739
Jo(e)rg Kienzle				Reehan Shaikh
Fall 2007					December 20

		Course Project README

IMPLEMENTATION:
Implementing Persistable in AspectOPTIMA,
taking care of interference with Shared
and Versioned.

Implemented using Eclipse 3.3.1.1, AspectJ
plug-in 1.5.1...., AspectJ 1.5.4.... and
JRE 1.6.0_03 set at compliance level 5.0
for the project.

USAGE:
PersistableAspect injects 4 functions into the
Persistable interface.

save(ObjectOutputStream out)
	persists the object to that specific stream.

save()
	constructs a default ObjectOutputStream out
	using the object's name and creates a
	FileOutputStream to "objectName.ser".
	This then calls save(out) with the default
	ObjectOutputStream.

load(ObjectInputStream in)
	unpersists the object from that specific stream.

load()
	constructs a default ObjectInputStream in
	using the object's name and creates a
	FileInputStream from "objectName.ser".
	This then calls load(in) with the default
	ObjectInputStream.

Intereference aspects (PersistableShared and
PersistableVersioned) intercept the required
method calls and ensure proper behaviour. No
usage is required from the user! Though the
user should ensure that the application is
doing what she wants it to do. A common bug
would be to save a Versioned object (in which
case the MAIN version is persisted) and then
load the persisted object into a newly created
object, thus creating 2 MAIN versions. See
the PerformanceMonitoringApplication.testVersioned
function for an example. It is up to the user
to ensure that this is taken care of!

Files modified (all under AspectOPTIMAreehanPersist/src/)

	1)  application1/PerformanceMonitoringApplication.java
	2)  application1/aspects/PerformanceMonitoringObjectAspect.aj	
	3)  library/aspects/object/CopyableSharedAspect.aj
	4)  library/aspects/object/PersistableAspect.aj
	5)  library/aspects/object/PersistableSharedAspect.aj
	6)  library/aspects/object/PersistableVersionedAspect.aj
	7)  library/interfaces/Persistable.java
	8)  library/interfaces/PersistableShared.java
	9)  library/interfaces/PersistableVersioned.java
	10) library/util/Debugger.java
	11) reehanReadme

1)  and 2) to have a test application. 1) has different functions
that "main" can call to test different aspects. The idea is to call
saveTest(..), then close the application, start it again but call
loadTest(..) to test is the serialization actually worked.
serializeNamed(..) tests if serialization actually persists
inter-type declarations, AND IT DOES. Then there is a testVersioned(..).

3) Fixed a bug that I found while developing 5). Calling object.wait()
will result in an infinite loop sometimes so changed to object.wait(500)
so it will do the check every 0.5 seconds!

4) - 6) aspects implementing the project

7) - 9) interfaces to the aspects

10) changed message system for easy readability

11) this document

#####
NOTE with a BIG MAYBE - still have to discuss this with prof:

Bug found in Versioned. Please see application1 (Performance
MonitoringApplication.java for details. There is a method called
testVersioned that shows this bug. I create a new version of an
object, set the new version's balance to x but both versions get
balance set to x. I don't know if this is the way Versioned is
supposed to work. Please email me for more details if you want.

reehan.shaikh@cs.mcgill.ca