Question

In: Computer Science

Consider the online auction site described in Problem 2.31 (Chapter 2, Page no 165). Suppose you...

Consider the online auction site described in Problem 2.31 (Chapter 2, Page no 165). Suppose you want to employ the Publish-Subscribe (also known as Observer) design pattern in your design solution for Problem 2.31. Which classes should implement the Publisher interface? Which classes should implement the Subscriber interface? Explain your answer. (Note: You can introduce new classes or additional methods on the existing classes if you feel it necessary for solution.).

Solutions

Expert Solution

Answer : Given data

* In an auction system there are many things to keep in mind .

* Auction Handler
* Bidder ( It has 2 types they are Random and Constant Bidder)
* Hence , see the code given below will be implemented by the Subsciber class because it will consists of all the properties
or attributes required for te running of the class with possible multiple inheritence and interface handling in the program .

* AuctionHandler.java

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

throw new NullPointerException("Id is null");

}
if (bids == null) {
throw new NullPointerException("Id is null");
}
this.bidId = bidId;
this.bids = bids;
}

Hence, this is the reason why the interfaces are used in the program to increase the readability,
scalability and integrity techniques in the program.

____________THE END_______________


Related Solutions

A new online auction site specializes in selling automotive parts for classic cars. The founder of...
A new online auction site specializes in selling automotive parts for classic cars. The founder of the company believes that the price received for a particular item increases with its age (i.e., the age of the car on which the item can be used in years) and with the number of bidders. The Excel multiple regression output is shown below. Summary measures Multiple R 0.8391 R-Square 0.7041 Adj R-Square 0.6783 StErr of Estimate 148.828 ANOVA Table Source df SS MS...
The online auction company eBay is discussed at length in the chapter. Using the Internet, research...
The online auction company eBay is discussed at length in the chapter. Using the Internet, research eBay’s competitors. Select one such competitor and write one or two paragraphs on how this company distinguishes itself from eBay.
Consider a private value auction with 2 bidders. The auction is carried out as a second...
Consider a private value auction with 2 bidders. The auction is carried out as a second price sealed bid auction where in case of a tie between the bidders, the winner is selected by a coin toss. The seller has valuation of the good of zero and will accept any bid at or greater than zero. Each bidder knows his/her own valuation, v, and does not know the valuation of the other bidder. It is common knowledge that the bidder...
In the focus problem at the beginning of this chapter, a study was described comparing the...
In the focus problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 469 eggs in group I boxes, of which a field count showed about 266 hatched. Group II nesting boxes boxes were placed in highly visible locations and grouped closely together. There were a total of 820...
In the Focus Problem at the beginning of this chapter, a study was described comparing the...
In the Focus Problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 463 eggs in group I boxes, of which a field count showed about 264 hatched. Group II nesting boxes were placed in highly visible locations and grouped closely together. There were a total of 808 eggs...
In the Focus Problem at the beginning of this chapter, a study was described comparing the...
In the Focus Problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 461 eggs in group I boxes, of which a field count showed about 264 hatched. Group II nesting boxes were placed in highly visible locations and grouped closely together. There were a total of 794 eggs...
In the Focus Problem at the beginning of this chapter, a study was described comparing the...
In the Focus Problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 463 eggs in group I boxes, of which a field count showed about 280 hatched. Group II nesting boxes were placed in highly visible locations and grouped closely together. There were a total of 788 eggs...
In the Focus Problem at the beginning of this chapter, a study was described comparing the...
In the Focus Problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 465 eggs in group I boxes, of which a field count showed about 272 hatched. Group II nesting boxes were placed in highly visible locations and grouped closely together. There were a total of 786 eggs...
In the Focus Problem at the beginning of this chapter, a study was described comparing the...
In the Focus Problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 493 eggs in group I boxes, of which a field count showed about 272 hatched. Group II nesting boxes were placed in highly visible locations and grouped closely together. There were a total of 810 eggs...
In the Focus Problem at the beginning of this chapter, a study was described comparing the...
In the Focus Problem at the beginning of this chapter, a study was described comparing the hatch ratios of wood duck nesting boxes. Group I nesting boxes were well separated from each other and well hidden by available brush. There were a total of 491 eggs in group I boxes, of which a field count showed about 260 hatched. Group II nesting boxes were placed in highly visible locations and grouped closely together. There were a total of 816 eggs...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT