Saturday, 27 July 2013

Week 8 - ZestLoops development and improvements

8th week over... This week I continued on development of ZestLoops. Unfortunately some problems with serialization/deserialization with gson forced me to edit the previous code, and to differentiate loops  between String and Integer values.
This change allows also a better representation of Loops based on Integers value (i.e. in the form "FOR i FROM 0 TO 10000000" ): in fact, the previous code consisted on the creation of a set of integers between 0 and 10000000 (westfulness).
The new design splits the representation of Loops based on Strings (which uses more or less the previous code) and the one based on Integers; this second type only persists the State of the loop, i.e. the start value, the current value and the final one (in the example above, at step 5, only the values 0,5 and 10000000 are persisted).

This representation was discarded in the previous Loop code, because it didn't allowed loops of the form "FOR token IN [1,2,3,5,6,4,8,9]". After a chat with the mentor, we decided to represent this last type of loop as a ZestLoop based on String instead of Integers. The main reason of this decision is the following: such loop type could be used only if an user wants to take the value and put it inside the request/response. For this reason it is reasonable to interpret these values as Strings.

This week I also performed some tests on the previous code. Tests seem to work and passed also after the changes made!

I hope to be able to push the definitive code in few days!

No comments:

Post a Comment