3

We're developing a transactional application in .NET (ASP.NET MVC, C#, Workflow Foundation, EntityFramework), and want to implement a system whereby users are notified of work that needs to be done based on events in the system. For instance, if an external interface call results in the cost for Widget A to be updated, then the user may want to go update the retail price for Widget A, or at least review it, so they need to be notified of the cost update.

Microsoft Dynamics CRM has the concept of Activity Feeds and the objects to support it. It seems to be the right sort of thing for what I need, though it also seems like a lot of infrastructure that I might not need. On the other hand, rolling my own seems like a good way to miss something important.

Before I go running down the rabbit hole of implementing one extreme or the other, I thought I'd ask here for a suggestion of something better (defined as less footprint than Dynamics CRM, yet pre-defined so I don't have to build my own). If I roll my own, I'm considering something like the following:

public class UserNotification
{
    // Notifications will go to Roles (groups of users)
    public Role RoleToNotify { get; set; }

    // A notification will be about an object that needs to be worked on
    public Type TypeOfThing { get; set; }
    public long IdOfThing { get; set; }

    // Time tracking
    public DateTime TimeOfNotification { get; set; }
    public DateTime TimeOfUserAction { get; set; }
}

Is there an alternative approach I should be considering?

1 Answer 1

1

It sounds like what you've described is a text-book example of when you should use the publish subscribe pattern, which is also known as the pub sub pattern.

Pub Sub is used when you have a Sender (e.g. Widget price update) and a variable number of Subscribers (e.g. parties interested in the price change), and what you described is a classic case for it.

As far as using the MS Dynamics CRM or rolling your own, I would certainly vote against rolling your own. Event queues aren't super complicated, but there are a large number of 3rd party providers that have already done that work for you and there's little for you to gain by rolling your own. Looking at the Wikipedia page for Message Broker software will give you a starting point, and depending upon your environment's requirements you'll easily be able to find something that meets your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.