Question & Answer
Question
How do you implement a Publish/Subscribe design Pattern in IBM Rational Rhapsody?
Cause
Rhapsody does not provide a Publish/Subscribe "Design Pattern" example.
Answer
Rhapsody allows you to send events with arguments and using these arguments is one way to implement the pattern.
The subscriber object is passed as an argument to the Publisher object via the evSubscribe event.
The message to be published is sent as an argument via the evPublish event to each Subscriber object subscribed to the Publisher.
![](/support/pages/system/files/support/swg/rattech.nsf/0/dfd4ef5f598b8eb985257f1f0039aacf/Content/0.7AA4.gif)
Project example is attached below.
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
---|
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21973530