开发者

Available frameworks/tools to send change notifications?

Is there a framework that will identify (through comparing the object) when an object property value has changed (user can specify which properties to "watch") and开发者_运维百科 then raise an event/send a notification?

Example: The app stores Person class in a database and keeps a copy in memory. The app retrieves the person data from the database to refresh the copy in memory periodically. Other apps/processes update the person data in the database. I want an event/notification raised when the mood property(list collection of strings: Upbeat,tired, etc.) of the person object is changed.

I know how to code this, but I get the feeling there is something out there that does this. Only two things I can think of that is similar is:

  • cache notifications, but haven't seen any that allow you to specify which properties/values to notify on. This would also require one to have a distributed cache server.

  • sql query notifications - I'm looking into this one.


Your description of the issue sounds a lot like what happens when you work with Entity Framework (and other ORMs). It's possible you could use the Entity Framework, and inspect the objects after they have been processed to detect changes. An example of which you can find here.

Is that the kind of thing you're looking for?

EDIT:

Regarding the Sql Query Notifications, take a look at the SqlDependency Class if you want to head down that route.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜