There are some other methods that are not shown here. But the idea is that I have a method that creates a HTTP Request and returns pointer to classAVariable
Then classAVariable is used by another method to complete the Web Request. I know that some of this is abstract and convoluted. but I inherited these interfaces, not really happy about the set up.
So really the classAVariable is a global variable that I would like to share throughout classA, classB, and classC.
Normally my domain is C#. Can someone please point out the error in my ways!
Without knowing why you need this variable I can't really give you any more details. Like I said before, it seems odd to have a member that all the classes need in order to work. If, from the method's perspective, its just some random data, then there should be no issue in terms of good/bad practice.
// the https response
virtual std::string getHeaderValue(std::string key);
virtual std::string getContentAsString();
// base class for httpsRequest
virtualvoid setHeaderValue(std::string key, std::string value);
virtual HttpsResponse* submit(); //caller takes ownership of result
// post request inherits from https request
class HttpsPostRequest : public HttpsRequest
virtual Uploader* UploadStream(); //caller takes ownership of result
WebCommunication(HttpsRequest* request, HttpsPostRequest* postRequest);
virtual HttpsPostRequest* makeHttpsPostRequest(std::string uri); //caller takes ownership of result
virtual HttpsRequest* makeHttpsGetRequest(std::string uri); //caller takes ownership of result
AppleHttpsRequest *appleRequest; // not sure I need these
AppleHttpsPostRequest *applePostRequest; // not sure I need these