Drama Llama
Splitting a large class and problems with a field needed in multiple classes as a result
So when outside code wants to call GetEmail() for example, they will call the OnlineConnectors implementation of it, which is a single line of code that calls the GetEmail() function in the EmailConnector, passing down the "connection" as a parameter and returning its return value. I can't help but feel this is very shoddy work and I am questioning if bidirectional association might be the answer - that way I could call the method in the EmailConnector directly and it could get the OnlineConnection from the associated OnlineConnector.
But I've practiced avoiding bidirectional associations during my education so much that at this point I can't help but feel that is a hack too! Am I thinking about this wrong / going about this wrong?
4 replies
❔ How to optionally include certain classes/libraries in a compile
The information as to which one of the two will be required will be available ahead of time. Think like I am either building for windows 7 or windows 8 - and needing two different libraries to make it work for each OS. In this sample scenario, I'd allow the user to just choose the version that's applicable to them.
40 replies