librelist archives

« back to archive

Some methods make sense in repository.[ch]

Some methods make sense in repository.[ch]

From:
Nacho
Date:
2011-08-13 @ 10:15
Hey guys,

here I am talking from a OO perpective. I've checked several bindings
and also in my bindings we are moving methods like tag_create, commit_create
to the git repository class. Doesn't it make more sense for you too having
it in repository.h ? At the end is something that the repository has to do,
and in the method you can see that the repository is the main "object".

Regards.

-- 
Ignacio Casal Quinteiro

Re: [libgit2] Some methods make sense in repository.[ch]

From:
Vicent Marti
Date:
2011-08-13 @ 16:57
Although the repository is indeed the main object of those methods, we
prefer to keep them on their respective header files for convenience
in both documentation and implementation (the actual code of these
methods is not on reopository.c either).

From an OO point of view, you can consider them static methods for the
blob/tree/commit/tag objects, not constructors.

Cheers,
Vicent

On Sat, Aug 13, 2011 at 3:15 AM, Nacho <nacho.resa@gmail.com> wrote:
> Hey guys,
> here I am talking from a OO perpective. I've checked several bindings
> and also in my bindings we are moving methods like tag_create, commit_create
> to the git repository class. Doesn't it make more sense for you too having
> it in repository.h ? At the end is something that the repository has to do,
> and in the method you can see that the repository is the main "object".
> Regards.
>
> --
> Ignacio Casal Quinteiro
>