Advanced PowerBuilder

HomePrevious Lesson: Which One To Choose, DDE Or OLE ?
Next Lesson: Registration Database

Deciding Where To Use DDE Or OLE

Does it make sense to add OLE support to the Application A as either a client or a server? Not really. We have data that we can provide to another application, but the application could easily render it for itself, so we wouldn't need to be an OLE server. We have no need to incorporate other data in our display, so we don't need to be an OLE client either.

You might say that we could be an OLE server and display the data, but what purpose would this serve? If we didn't provide the data via DDE as well, the client application would only be able to show an image of the data and not access it in any other way. That means that it couldn't plot a graph, set trigger alarms, or whatever because an OLE client treats the data as a black box and has no knowledge of its format.

The Graph application need to be at least DDE client application, to accept data from the Application A. You might add DDE Server support, but, it is not required; this is because, for plotting the graph, it needs the data from other applications, but, it has no need of sending the data. Making this as OLE Server makes sense, because other applications can embed or link to this graph. Since the graph is in a special format, other application can invoke this application whenever it needs to be manipulated. Similarly sound recording application also should be at least OLE Server enabled.

Word-Processor application doesn't have much use for live, changing data that it needs to manipulate, so we aren't really interested in becoming a DDE client. Making this application into an OLE client makes a lot of sense. It enables other data types to be attached to the text being displayed, i.e., attaching a graph of our stock market prices and a sound recording of the CEO. We don't need to be able to render the images of these data types because that's the responsibility of the OLE server. We also get a free editor for our graph because the OLE server provides that support.

We could also add OLE server support for the word-processor. That way, the entire document could be linked to or embedded in another application document.
HomePrevious Lesson: Which One To Choose, DDE Or OLE ?
Next Lesson: Registration Database