Issue: Put load and save operations in the Element/List objects or put them in another IO type object?
Discussion: In the Element/List object. The argument could be made that the object itself knows best how to save itself, so the object should have the save function as a method.
In another IO object. This makes sense because there are different types of saving (XML, delimited, serialized, etc.) and with each one, there other options, such as the delimiter, which are global in nature. The destination/source of the saved/loaded data is also not the concern of the object, so it should be offloaded to an IO object. That way if you change the type, options, or destination, the Element/List object doesn’t need to change, only the IO object. If the same IO object is used for many different Element/List/Other objects, only the IO object needs to be changed.
Conclusion: The save and load operations should be in an IO type object, not the Element/List objects.
Issue: How to implement using an IO object within the Element/List objects?
Discussion: If you use an XML or delimited format, you may need to iterate over each Element in the List, asking for it to save itself. If you are using the serializable method, only the List need be “saved”. The list should take care of serializing each element, assuming they have been marked as serializable.
In the case of XML or delimited, the value of each cell would be returned as the value object. They would have to be returned in sequence, preferably by an Iterator. The IO object would determine if the value is converted to a String or not. The Iterator would also have to access the Tic to get the name of each cell for an XML save (I think).
If the method was to serialize, then the save method on an Element would be ignored, because the List would save each Element.