After taking a break from the laptop I was able to get a much better handle on interfaces in Delphi. And I was able to implement the design I wanted. It's not as slick as in C# but it works. And the code is readable, which is important to me.
I was returning a TObject when I should have been returning IInterface. After seeing the code it makes sense to me why my use of TObject was causing problems, and why I was trying to cast an interface from an object, which now I see was not needed.
I found that I could make those Interfaces sorta work, but I never quite got it perhaps. I had really problems with typecasing... I think it was when I was trying embedded-forms. Instead I just made a base-class of TMyEmbeddedForm or whatever, made abstract placeholders for common props/methods I woulda otherwise used Interfaces for, and that worked much better.
posted by Mike | May 13 10:04 AMAdd Your Comment
