Офлайновые опции синхронизации с.NET

Значение Ваших двух примеров бессмысленно, бесполезно и только сделанное одурачить компилятор.

компилятор не способен (и не должен быть) видеть значение метода, цикла или программы. Это - то, где Вы входите в изображение. Вы создаете метод для определенной функциональности/значения, неважно, насколько глупый это. Это - тот же случай для простых проблем или экстремальных сложных программ.

В Вашем случае компилятор мог бы оптимизировать его, потому что это "думает", что должно быть оптимизировано в другом отношении, но почему остаются там?

Экстремальное значение другая ситуация. У нас есть умный компилятор, компилирующий Windows. Тонны кода для компиляции. Но если это умно, это сводит его к 3 строкам кода...

"starting windows"
"enjoy freecell/solitaire"
"shutting down windows"

Остальная часть кода является устаревшей, потому что это никогда не используется, затрагивается, получается доступ. Мы действительно хотим это?

5
задан John Saunders 30 September 2009 в 19:19
поделиться

2 ответа

The Microsoft Sync Framework definitely supports the scenario you describe, although I would say that it's fairly complicated to get it working.

One thing to understand about the Sync Framework is that it's really two quite distinct frameworks shipping in the same package:

  • Sync Framework
  • ADO.NET Sync services v. 2

The ADO.NET Sync services are by far the easiest to set up, but they are constrained to synchronizing two relational data stores (although you can set up a web service as a remote facade between the two).

The core Sync Framework has no such limitations, but is far more complex to implement. When I used it about six months ago, I found that the best source to learn from was the SDK, and particularly the File/Folder sync sample code.

As far as I could tell, there was little to no sharing of code and types between the two 'frameworks', so you will have to pick one or the other.

In either case, there are no constraints on how you host the sync code, so Windows Forms is just one option among many.

9
ответ дан 13 December 2019 в 19:30
поделиться

If I understand correctly, this doesn't sound like an actual data synchronization issue to me where you want to keep two databases in sync. it sounds more like you want a reliable mechanism for a client to call functions on a server in an environment where the connection is unstable, and if the connection is not present at the time, you want the function called as soon as the connection is back up.

If my understanding is right, this is one option. if not, this will probably not be helpful.


This is a very short answer to an in-depth problem, but we had a similar situation and this is how we handled it.

We have a client application that needs to monitor some data on a PC in a store. When certain events happen, this client application needs to update our server in the corporate offices, preferably Real-Time. However, the connection is not 100% reliable, so we needed a similar mechanism.

We solved this by trying to write to the server via a web service. If there is an error calling the web service, the command is serialized as an XML file in a folder named "waiting to upload".

We have a routine running in our client app on a timer set for every n minutes. When the timer elapses, it checks for XML files in this folder. If found, it attempts to call the web service using the information saved in the file, and so on until it is successful. Upon a successful call, the XML file is deleted.

It sounds hack-ish, but it was simple to code and has worked flawlessly for five years now. It's actually been our most trouble-free application all-around and we've implemented the pattern elsewhere successfully

2
ответ дан 13 December 2019 в 19:30
поделиться
Другие вопросы по тегам:

Похожие вопросы: