Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2005-10-03 21:34:54
Size: 150
Editor: pix39
Comment:
Revision 3 as of 2005-10-04 20:10:04
Size: 1246
Editor: mskresolve-b
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).

RFC_1/RFC1_Comment_Maps (last edited 2009-02-12 01:03:17 by localhost)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux