Re: [Vala] Libgee's Roadmap proposal



Re,

Quikee wrote:
Hi,

- is_empty()
Do we make this a property or a method ?

I think this should be a method as it generally is only a convenience
method for size property.

- is_empty()
Same comment as for Collection.is_empty() - property or method ?

It is the same here as above.

But those could equally be represented as a property or method.
Properties may only be gettable and have a real function body to be
implemented. The only difference is from the point of view of the user,
having to add a parenthesis pair or not.

- set_all(Map<K,V> map)
Do we provide also remove_all and contains_all ?

Not yet but those make sense. I will add them today.

Cool.

One observation is that implementation of most of the methods could be
generic for all,  which means that they could be implemented on the
interface itself but maybe it would be better to introduce a common
abstract superclass just to keep interfaces clean.
Yes we have to provide some AbstractCollection and AbstractMap base
implementations.

In this case I will provide the implementation because currently the
only common code are those additional methods.

In fact I am, at the time we speak, just working on that. So maybe do
not introduce the abstract classes, just implement the methods on one of
them and I'll will rebase the whole (but keep your authorship).

I may push that in the end of the afternoon.

Could you provide some patches for all the above ?

All the best, Didier.


Of course. I have the changes locally in the git repository. I am new
to git so I don't really (yet) how to provide the changes most
efficiently. But first I will like to clean up the code and write
"vala docs" for the methods properly.

Oki :)

One additional thing I had saw what could be improved in the tests is
to provide tests for interfaces itself. For example test for List
interface methods would be the same for all the implementations
ArrayList and LinkedList because they should behave the same anyway. I
saw that most of the test between implementations are anyway
copy/paste which is not efficient when test are added of changed. I
have already made a example how this could be done efficiently but
first I want to finish the first task.

That is true. I would also like to enhance that. I had no time for now
to do it. We can do that later in another commit.

Didier.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]