[Yanel-dev] Contracts of Storage.getSize() etc.

Andreas Wuest awuest at student.ethz.ch
Mon Feb 12 15:58:11 CET 2007


Hi Josias

On 12.2.2007 15:44 Uhr, Josias Thöny wrote:

> Andreas Wuest wrote:
>> Hi
>>
>> What are the contracts of getSize(), delete() and getRevisions() of 
>> the Storage interface?
> 
> The yarep API is currently undergoing a transition from the path-based 
> methods to a node-based API. The old methods were deprecated in 
> Repository.java, and I do not really recommend to use the Storage 
> interface any longer. I'm sorry for the lacking documentation, the whole 
> thing is a WIP.

Hmm, ok. I don't know who is going to use the XMLDBStorage besides the 
Annotation resource (I guess my blog resource will also use it, but I 
merely work on it in my free time), so I guess I am not going to convert 
it anytime soon.

I had a look at the node based repo stuff and it looks promising. Of 
course, it would be nice if we could have one clean interface, and get 
finally rid of the deprecated stuff (not that there are many consumers 
of this interface outthere yet which couldn't be converted).

> The getRevisions() method does not have any contract, because its 
> purpose was to show "any kind of information" about the revisions, 
> merely for displaying it to the user. It was added with the idea of 
> replacing it later by real versioning (see Node.java and Revision.java).
> As for the other two methods, I have no idea about their contracts. 
> Please feel free to define one.

Ok. Unfortunately, Yanel does not seem to do too good with regards to 
error handling, so it looks like I have to adapt the contracts to take 
this in consideration.

For example, before I implemented getSize, I threw a 
RepositoryException, because returning 0 did not make sense. Of course, 
Yanel then simply failed.

-- 
Kind regards,
Andi




More information about the Yanel-development mailing list