Erling Posted June 29, 2010 Report Share Posted June 29, 2010 I would like to have a component receive different transactions, but that would require the component to overload member functions, for example: function void write(Trans1 t); function void write(Trans2 t); This does not work, though, because the compiler rejects the overload. A single write function taking a superclass of Trans1 and Trans2 does work, but the result is ugly and not OOP like with casting to reveal the type info lost in the call. Another solution is to split the component in two, but it may be valid reasons to receive different transactions in the same context. Is there a better way to deal with this situation? Erling Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.