You are currently viewing Object Oriented: Transaction Publishers and Subscribers

Object Oriented: Transaction Publishers and Subscribers

Spread the love

Publishers and Subscribers of Transaction

Classes That Should Execute the Subscriber Interface in a Transaction

The buyer class would implement the subscriber interface. We are concerned about the publisher and the subscribers here. We can view the relationship between them as follows:



The Publisher releases events of notice to other entities. The event would take place as soon as the publisher activates the condition for selling, bidding and buying services for the online auction site tools to execute according to their functions and responsibility. The tools of the Publisher would include a participation frame that lets bidders interested in bidding before the buying time is reached and registered on the purchasing list on the bidders’ interface which is the BidForItem interface. See figure 1 below.


Subscriber Interface

The selling/bidders/buyer interface implemented by the subscriber interface which includes SellerInfo, bidsList, and BuyerInfo is responsible for declaring the notification interface; the process has multiple parameters that enable the publisher to transmit several event features with the update made. The winning bidders are required to respond to the notifications issued by the publisher regarding their bids with instructions on where they stand and a payment interface enabled for them to make purchases within a timeframe. All of these are implemented through the subscriber interface. See figure 1 below.

The subscribers are entitled to appropriate details to enable them to respond to the update made appropriately and so the publisher is required/mandated to input specific background data which serve as arguments of the announcement/notice method which also helps the subscribers to get information or data right away.


Figure: Publisher-Subscriber Object Flow

Before publishing an auction to bidders, the publisher must set events for either random and/or constant bidders and, above all, must create a class which states the inheritance and interface features for handling the auction/bidding/buying features.


Readability, Scalability and Improve Integrity

To enhance auction’s readability, scalability and improve integrity the code below can be used to handle the functionality/effectiveness of the interface.

public AuctionHandler(CharSequence bid.b,
ConcurrentMap<Long, ConcurrentMap<CharSequence, BidResponse>> bids) {
if (bid.b == null) {

throw new NullPointerException(“b is null”);

if (bids == null) {
throw new NullPointerException(“b is null”);
} = bid.b;
this.bids = bids;








Leave a Reply