In this class, I ended up creating some level of data:
public class DataRequest { public class DataResponse { public DataResponse(DataRequest req) { Request = req; } public DataRequest Request {get; set;} // ... here go some other fields ... } public Response { get; set; } public DataRequest() { Response = new DataResponse(this); } public void Execute() { ... Get some data and fill Response object ... } }
I need a request to keep abreast of the answer because it fills it with data; I need an answer to know about the request, because when I pass the response to some other methods, I want to have access to the original request.
Do you see any potential problems with this architecture, such as memory leaks, etc., or is it just a bad design idea?
source share