Re: Interface as Object. can I do this?
From: Ender (linuxmustdie_at_hotmeil.com)
Date: 10/23/03
- Next message: Joanna Carter: "Re: Component Conversion - D5 to D7"
- Previous message: Dion Oliphant: "Component Conversion - D5 to D7"
- In reply to: Joanna Carter: "Re: Interface as Object. can I do this?"
- Next in thread: Gert Kello: "Re: Interface as Object. can I do this?"
- Reply: Gert Kello: "Re: Interface as Object. can I do this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 23 Oct 2003 15:47:08 +0600
> | How can I convert a interface in a object?
Joanna Carter wrote:
> You can't apart from some very nasty hacking and you shouldn't.
>
> Google for threads on the topic of interfaces and object references,
> unless you don't value your sanity, use all interfaces or all objects,
> don't mix them without a lot of experience.
Because of interface reference counting using an object reference is
strictly not recomended. Taking an object reference from interface does not
raise RefCount for object, so object itself may be destroyed at any time
while you using it through object reference.
One of ways to prevent this, hold a collection of objects with RefCount set
at 1 on creation of object. That objects will never be destroyed through
interface reference counting. You may take interfaces from this objects at
any time, they should not interfere with object references.
I don't think that technique is "nasty hacking". Just other reference
counting strategy.
- Next message: Joanna Carter: "Re: Component Conversion - D5 to D7"
- Previous message: Dion Oliphant: "Component Conversion - D5 to D7"
- In reply to: Joanna Carter: "Re: Interface as Object. can I do this?"
- Next in thread: Gert Kello: "Re: Interface as Object. can I do this?"
- Reply: Gert Kello: "Re: Interface as Object. can I do this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|