← Revision 4 as of 2005-10-03 21:25:07
Size: 1250
Comment:
|
← Revision 5 as of 2005-10-04 14:19:22 →
Size: 2028
Comment: Provided counter-argument to Rowan's proposal re: compile time checks.
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
IlianaAvila -9/30/05- Since the methods are returning wrapper objects, ignore the comment above. | IlianaAvila - 9/30/05- Since the methods are returning wrapper objects, ignore the comment above. |
Line 7: | Line 7: |
RowanChristmas 10/03/05 - I don't like being able to have the user get direct access to Lists and Maps. It doesn't allow us to enforce, at compile time, what objects are actually going to be stored. I preferred, and this mirrors what CyData/CyDataDefinition has, is to have this class provide the List/Map methods itself, and force manipulations. | RowanChristmas - 10/03/05 - I don't like being able to have the user get direct access to Lists and Maps. It doesn't allow us to enforce, at compile time, what objects are actually going to be stored. I preferred, and this mirrors what CyData/CyDataDefinition has, is to have this class provide the List/Map methods itself, and force manipulations. |
Line 27: | Line 27: |
EthanCerami - 10/4/05 - In Rowan's original interface for {{{CytoscapeData}}}, we had the following: {{{#!java public int addAttributeListValue (String identifier, String attribute, Object value); }}} This won't enforce data typing at compile time either. Of course, neither will the new {{{setAttributeList()}}} method. So, I don't think we can use the compile-time check as a valid criteria to compare the two approaches. However, on grounds of simplicity of API, I would much rather see just one method with clear run-time checks over the 4-5 methods that Rowan's approach would require. To Rowan's second point, if I set a single value, and then set a list, then the single value would be overwritten. I think that's OK, and not very confusing. |
Describe RFC 1/RFC1 Comment Lists here.
IlianaAvila, 9/30/05 - What do you think of using Colt (http://dsd.lbl.gov/~hoschek/colt/api/index.html) for the backend implementation of Lists? This way we don't have to convert from Double to double, Integer to integer, etc.
IlianaAvila - 9/30/05- Since the methods are returning wrapper objects, ignore the comment above.
RowanChristmas - 10/03/05 - I don't like being able to have the user get direct access to Lists and Maps. It doesn't allow us to enforce, at compile time, what objects are actually going to be stored. I preferred, and this mirrors what CyData/CyDataDefinition has, is to have this class provide the List/Map methods itself, and force manipulations.
Current:
1 List list = new ArrayList();
2 list.add( new Double(5) );
3 list.add( new Booolean(true) );
4
5 CyAttributes.add(id, att, list );
6 //---> exceptions thrown
7
Rowan preferred:
1 CyAttribute.addListAttributeValue( id, att, new Double(5) );
2 CyAttribute.addListAttributeValue( id, att, new Booloean(true) );
3 //----> exceptions thrown
4
There is also the question of what happens when I set a single value, then set a list....does the single value get overwritten? What about for Maps?
EthanCerami - 10/4/05 - In Rowan's original interface for CytoscapeData, we had the following:
1 public int addAttributeListValue (String identifier, String attribute,
2 Object value);
3
This won't enforce data typing at compile time either. Of course, neither will the new setAttributeList() method. So, I don't think we can use the compile-time check as a valid criteria to compare the two approaches. However, on grounds of simplicity of API, I would much rather see just one method with clear run-time checks over the 4-5 methods that Rowan's approach would require.
To Rowan's second point, if I set a single value, and then set a list, then the single value would be overwritten. I think that's OK, and not very confusing.