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.

posted by Kirby Turner | 04-May-2005 8:18 PM | comments (1)


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 AM

Add Your Comment

Comment:
(No HTML)

Name:
E-mail/Web site:
Your e-mail/web site will not be published on this site. It is optional and will only be used by me should I need to contact you directly.
 
By checking this option, this site will remember your name and e-mail/web site on future visits. Uncheck this option to have the site not remember who you are on future visits.
 
Enter the code shown above:
Copyright © 1999-2008 Kirby Turner.
Site software written by White Peak Software Inc, a provider of custom software and software development coaching.