← Revision 1 as of 2005-10-03 21:34:54 →
Size: 150
Comment:
|
Size: 1246
Comment: Recorded decision of subgroup re: lists/maps
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
RowanChrismtas 10/03/05 -- enforcing the String as Key, Value as type would be even easier if the methods were just a part of the API directly, imo. |
RowanChrismtas - 10/03/05 - enforcing the String as Key, Value as type would be even easier if the methods were just a part of the API directly, imo. EthanCerami - 10/5/05 - However, your proposed approach doesn't provide compile-time checks either. Here's an example method from {{{CytoscapeData}}}: {{{#!java public int putAttributeKeyValue (String identifier, String attribute, String key, Object value); }}} The only way to enforce checking at compile time is to create a whole suite of methods, e.g. {{{#!java public int putAttributeKeyValue (String identifier, String attribute, String key, String value); public int putAttributeKeyValue (String identifier, String attribute, String key, Boolean value); public int putAttributeKeyValue (String identifier, String attribute, String key, Integer value); public int putAttributeKeyValue (String identifier, String attribute, String key, Double value); }}} And, I think we can agree that this will result in way too many methods. EthanCerami - 10/4/05 - Subgroup (Nerius, Iliana, Ethan) agreed to go with single set of getters/setters for Lists and Maps, e.g. we vote to go with setAttributeList(List list), and setAttributeMap(Map map). |
RowanChrismtas - 10/03/05 - enforcing the String as Key, Value as type would be even easier if the methods were just a part of the API directly, imo.
EthanCerami - 10/5/05 - However, your proposed approach doesn't provide compile-time checks either. Here's an example method from CytoscapeData:
1 public int putAttributeKeyValue (String identifier, String attribute,
2 String key, Object value);
3
The only way to enforce checking at compile time is to create a whole suite of methods, e.g.
1 public int putAttributeKeyValue (String identifier, String attribute,
2 String key, String value);
3 public int putAttributeKeyValue (String identifier, String attribute,
4 String key, Boolean value);
5 public int putAttributeKeyValue (String identifier, String attribute,
6 String key, Integer value);
7 public int putAttributeKeyValue (String identifier, String attribute,
8 String key, Double value);
9
And, I think we can agree that this will result in way too many methods.
EthanCerami - 10/4/05 - Subgroup (Nerius, Iliana, Ethan) agreed to go with single set of getters/setters for Lists and Maps, e.g. we vote to go with setAttributeList(List list), and setAttributeMap(Map map).