Patrick Ohly | 4 Aug 17:10
Picon
Favicon
Gravatar

internal SyncSource API redesign

Hello!

Bob's questions made it clear that some of the internal API changes
should be done rather sooner than later. There are several other
enhancement ideas which depend on similar changes:

#5047 ODBC sync source
#5049 field list sync source (the feature needed by Bob)
#5046 raw file sync source
#3472 SyncEvolution code cleanup (EvolutionSyncClient and
EvolutionSyncSource class names, namespaces)

Let me summarize my current thinking. In order to do something useful in
SyncEvolution, a backend
      * must implement the part which integrates it into the framework
        (meta information like name, Synthesis XML config fragments) =>
        SyncEvolutionBackend, a subset of the current
        EvolutionSyncSource
      * must implement the Synthesis DB Interface, a varying (depending
        on the backends capabilities) number of C-style function
        callbacks => provide a mechanism how SyncEvolution backends can
        bind these callbacks to methods in their own object, but without
        prescribing a specific interface as EvolutionSyncSource does
        right now
      * if automatic testing is desired, it must implement a standard
        interface for iterating over changes and another interface to
        import/export data (in contrast to the current solution, were
        iterating over items includes item data exchange - this was
        inherited from the Funambol C++ client library and should be
        changed also for other reasons)
(Continue reading)

Patrick Ohly | 6 Aug 22:35
Picon
Favicon
Gravatar

Re: internal SyncSource API redesign

On Tue, 2009-08-04 at 16:10 +0100, Patrick Ohly wrote:
> The interfaces must be pure virtual to allow multiple inheritance.
> Default implementations of them provide the current functionality (for
> example, EvolutionSyncSource: iterate over fixed lists of changes,
> import/export items as blobs) and hook that up with the Synthesis DB
> Interface. An implementor can put all of his code in one class which is
> derived from the appropriate base classes.

I've implemented that concept and committed it to the "backend-api"
branch. Warning, the code is not stable. Be prepared for a somewhat
volatile branch and forced updates when pulling it.

The code currently is complete enough to run sync sessions with the
command line. The GUI and syncevo-dbus-server also compile. What is
missing is the adaption of ClientTest.cpp to the updated API. Therefore
it doesn't compile yet, which prevented more intensive tests today.

> The current EvolutionSyncSource and TrackingSyncSource would do that to
> preserve the current, rather simple to implement API, and to avoid
> rewriting existing backends. I would rename EvolutionSyncSource though
> and move the remaining Evolution specific code into a common class in
> src/backend/evolution.

The equivalent of the former EvolutionSyncSource is now SyncSource.
EvolutionSyncSource made a comeback as base class for all EDS sync
sources.

TrackingSyncSource documents the whole API, just as it did before, even
for those methods which are inherited from base classes. The goal is
that someone can copy/paste that class, fill out the pure virtual
(Continue reading)

Patrick Ohly | 10 Aug 16:04
Picon
Favicon
Gravatar

Re: internal SyncSource API redesign

On Thu, 2009-08-06 at 21:35 +0100, Patrick Ohly wrote:
> On Tue, 2009-08-04 at 16:10 +0100, Patrick Ohly wrote:
> > The interfaces must be pure virtual to allow multiple inheritance.
> > Default implementations of them provide the current functionality (for
> > example, EvolutionSyncSource: iterate over fixed lists of changes,
> > import/export items as blobs) and hook that up with the Synthesis DB
> > Interface. An implementor can put all of his code in one class which is
> > derived from the appropriate base classes.
> 
> I've implemented that concept and committed it to the "backend-api"
> branch. Warning, the code is not stable. Be prepared for a somewhat
> volatile branch and forced updates when pulling it.

I've pushed another revision to the branch. The Client::Source tests
pass now (*), so I'm optimistic that the refactoring didn't break
anything. Any further changes will be done as new commits on that
branch.

The patch is rather large, but it also removed a lot of cruft:
42 files changed, 2779 insertions(+), 3794 deletions(-)

One piece of functionality was removed and not added again yet: logging
of item changes as they occur. Previously, the syncevolution command
line would log "[INFO] addressbook: adding 'Doe, John'" or something
like it. This was implemented via some backend specific callback which
would peek into the item data to extract a short description.

A much better implementation in combination with the Synthesis engine
would be to read the right fields from the field list. I'll add an
utility class and the necessary hooks.
(Continue reading)

Patrick Ohly | 13 Aug 18:30
Picon
Favicon
Gravatar

Re: internal SyncSource API redesign

On Mon, 2009-08-10 at 15:04 +0100, Patrick Ohly wrote:
> One piece of functionality was removed and not added again yet: logging
> of item changes as they occur. Previously, the syncevolution command
> line would log "[INFO] addressbook: adding 'Doe, John'" or something
> like it. This was implemented via some backend specific callback which
> would peek into the item data to extract a short description.

This is available now via the new SyncSourceLogging. Evolution contact
source reimplements the logging with it in a nicer way and
calendar/task/memo source print an item description using the new
infrastructure for the first time.

> A much better implementation in combination with the Synthesis engine
> would be to read the right fields from the field list. I'll add an
> utility class and the necessary hooks.

See SDKInterface and get/setValue(). This currently works for string
fields, other types coukld be added in a similar way.

There also were quite a few bug fixes. Spare me the trouble (and
embarrassment) of listing them here; see the branch history for details
instead...

--

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
(Continue reading)

Patrick Ohly | 25 Aug 10:08
Picon
Favicon
Gravatar

Re: internal SyncSource API redesign

On Thu, 2009-08-13 at 17:30 +0100, Patrick Ohly wrote:
> > A much better implementation in combination with the Synthesis engine
> > would be to read the right fields from the field list. I'll add an
> > utility class and the necessary hooks.
> 
> See SDKInterface and get/setValue(). This currently works for string
> fields, other types coukld be added in a similar way.
> 
> There also were quite a few bug fixes. Spare me the trouble (and
> embarrassment) of listing them here; see the branch history for details
> instead...

... except that I now have rebased the branch and merged all bug fix
commits into the initial API change commit, in preparation for getting
this merged into the "master" branch.

Congwu, you are currently looking into the backend API as part of the
SDK tutorial work. Can you review the "backend-api" branch? I'd like to
get it merged tomorrow, after one full nightly test run with your
"message resend" patches. The goal is a 0.9.1 release with these changes
middle of September (but that also depends on the D-Bus API discussion,
bug reports and demand).

--

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
(Continue reading)

Chen, Congwu | 25 Aug 10:38
Picon
Favicon

Re: internal SyncSource API redesign

>Congwu, you are currently looking into the backend API as part of the
>SDK tutorial work. Can you review the "backend-api" branch? I'd like to
>get it merged tomorrow, after one full nightly test run with your
>"message resend" patches. The goal is a 0.9.1 release with these changes
>middle of September (but that also depends on the D-Bus API discussion,
>bug reports and demand).
Yes, I will look at it
Chen, Congwu | 26 Aug 10:29
Picon
Favicon

Re: internal SyncSource API redesign

>>Congwu, you are currently looking into the backend API as part of the
>>SDK tutorial work. Can you review the "backend-api" branch? I'd like to
>>get it merged tomorrow, after one full nightly test run with your
>>"message resend" patches. The goal is a 0.9.1 release with these changes
>>middle of September (but that also depends on the D-Bus API discussion,
>>bug reports and demand).
>Yes, I will look at it

Looks good. 
One small question: 
SyncSourceSerialize: SyncSourceBase, SyncSourceRaw and 
SyncSourceRaw: SyncSourceBase

Why do we need extend SyncSourceBase again in SyncSourceSerialize?
Patrick Ohly | 26 Aug 15:41
Picon
Favicon
Gravatar

Re: internal SyncSource API redesign

On Wed, 2009-08-26 at 09:29 +0100, Chen, Congwu wrote:
> >>Congwu, you are currently looking into the backend API as part of the
> >>SDK tutorial work. Can you review the "backend-api" branch? I'd like to
> >>get it merged tomorrow, after one full nightly test run with your
> >>"message resend" patches. The goal is a 0.9.1 release with these changes
> >>middle of September (but that also depends on the D-Bus API discussion,
> >>bug reports and demand).
> >Yes, I will look at it
> 
> Looks good. 
> One small question: 
> SyncSourceSerialize: SyncSourceBase, SyncSourceRaw and 
> SyncSourceRaw: SyncSourceBase
> 
> Why do we need extend SyncSourceBase again in SyncSourceSerialize?

It's redundant, but it also doesn't hurt ("virtual public" ensures that
the class is only inherited once). One advantage is that
SyncSourceSerialize doesn't have to make the assumption that
SyncSourceRaw is derived from SyncSourceBase.

SyncSourceRevisions does the same thing.

Okay, so I went ahead, rebased the branch against the latest master and
merged it. Let's see how this breaks, eh, passes the nightly testing.

In related news, I've tentatively scheduled "#5049 - sqlite: field list
sync source" for SyncEvolution 0.9.1. It would be really nice to get
this example backend up to the latest source code revision again
together with the backend API change.
(Continue reading)


Gmane