Helloo everybody,

I'm in the midst of attempting to create a publisher-subscriber design. What i understand is that a publisher-subscriber pattern will mainly include distributing messages to certain subscribers at certain times. I was thinking there would be a "publisher" class & a "subscriber" class and later on publisher will have a list of subscribers inside a for loop. With each subscriber in the for loop, a fucntion to update each subscriber will be implemented.

If anyone could help me with perhaps possibly giving any guidelines (through simple description based on thoughts, particular functions i should consider or even certain links to tutorials) i'd be very thankful. Links to tutorials will be VERY welcomed.

Pattern catalog items don't typically contain implementations, because they are language independent. It is the job of the programmer to provide the implementation. Some useful patterns are provided in well-known libraries. The publisher and the subscriber classes are provided in the package called Java utility package, where they are known as Observable and Observer. The specializations of the classes publisher and subscriber are also provided in the Microsoft Foundation Class library, where they are known as CDocument and CView, and IBM's Visual Age library, where they are known as Notifier and Subscriber. But, the standard C++ library doesn't contain Publisher and Subscriber, so we'll have to implement them ourselves. There are many methods to follow one loosely based on the Java implementation.

You can get more details including the example of showingh code to the program implementation if you search online for it. Just try searching for the information you nee, you will get some relevant data.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.