d3scomp / JDEECo-old

JDEECo is a Java implementation of the DEECo domponent system
0 stars 0 forks source link

Implement support for decomposition of hashmaps and lists in the tuple-space #1

Open bures opened 12 years ago

bures commented 12 years ago

The hashmaps and lists should be decomposed in a way similar to the example below:

class A { HashMap <String, String> h; List l; }

....h.put("apple","v1"); ....h.put("orange","v2"); ...l.add("xyz"); ...l.add("wyz");

Keys in the tuple space are: ..."h"."apple" = "v1" ..."h"."orange" = "v2" ..."l"."0" = "xyz" ..."l"."1" = "wyz"

For the time being, it is OK to support only hashmaps which have the key of type String. Later on, if we would like to allow for any serializable object to be the key, we would have to change the definition of class Tuple to use Object for key (instead of String).

The mapping has the feature that a list in the tuple space may be seen also as a hashmap. Similarly an object in the tuple space with all fields of the same type may be seen as a hashmap. The hashmap can be also seen as an interface with fields which are a subset of the keys in the hashmap.

mkit commented 12 years ago

Partial support for both lists and maps is done. Casting maps to interfaces is provided naturally (according to the current implementation). However, other way round i.e casting interfaces to maps is not completed yet.