Showing links to other modules in a list of items

Topics: CAB & Smart Client Software Factory
May 1, 2007 at 4:22 AM

I have a view which is showing a list of customers.
I have other modules which show other information for a customer.

What is a good approach to adding a link to each customer row, from other modules which will show the other information.

I can imagine each row being another View (UserControl) with its own UIExtensionSite and creating a new WorkItem. An event would fire off and other modules could poke buttons in. This seems a very complicated way of doing it though.

The other way I can see would be to raise an event when every row was displayed which would have some sort of container which would collect links from other modules.

And the other way I can see is for the View displaying the items to be aware of what it could link to in other modules.

Any advice would be great.


May 1, 2007 at 4:23 PM
My first question would be: if all of these modules are related to displaying information about a customer, why are they in separate modules?

As for a solution: If I had to implement this, I'd probably choose to create a service for such behavior. Part of the responsibility of the service would be to allow for the creation of Link items. So you could call something like:

service.AddLink(customerID,  text);

Then you could call the service during creation of your customer "rows" to get all of the links for that customer (by passing a customerID) and display them on the screen.

May 2, 2007 at 1:56 AM
Why are they in separate modules - due to a decision by someone else (heh heh, Teflon coating)!!
Although that's a really interesting thing to question...

Up until reading your question I thought that different aspects of an application (in our case Customers, Deals, Documents) pointed you towards what should be in a separate module and that the Customer module should have no concept of a Deal... No wonder it was feeling smelly and getting complicated.

It seems to make more sense if the customer module knows about deals related to a Customer to a point where it can list the deals, or show a button to link to deals, but the Deals module is the thing which is displaying / creating the detail of a deal.
Does that sound like a better starting point or would you suggest we think about going further and putting the deals and Customer into the same module?

Are there any good reference papers you can point to that discuss this sort of thing in more detail?