2022 Developer Survey is open! Take survey.

New answers tagged

2 votes
Accepted

Adapter pattern in C++ via Inheritance and Composition

Incorrect use of inheritance There is a problem with class AdapterInheritance. It contains both the member variables of ...
user avatar
  • 32.5k
0 votes

Requests and handling requests

Here is a fully compiling code using the two-layered Observer Pattern suggested by G. Sliepen. There are two separate lists of observers, those who received the requests and those who accepted the ...
user avatar
  • 1,089
2 votes

Requests and handling requests

Using design patterns For this task, I don't think that the Observer Pattern cannot be used in its classic form. I'm assuming the double negative there was not intentional. Indeed, each software ...
user avatar
  • 32.5k
1 vote

Abstract Factory Pattern Implementation

Abstract Factory Pattern helps in correctly creating the families of related products. Using ExporterFactory, one could create a combination of LQVideoExporter and HQAudioExporter which I believe is ...
user avatar
0 votes

Observer Design Pattern in C++ to model magazine subscriptions

Please consider the possibility of more types of subscribers in future. To immune or have least impact on the existing code, you can use Factory Pattern to create subscriber as followed: ...
user avatar

Top 50 recent answers are included