RE: [Reflex] Adding support for attributes

From: Jean-Francois Bastien <jfbastien_at_cae.com>
Date: Tue, 22 Jan 2008 15:41:06 -0500


> Correct.
>
> The first MS URL you sent talks about using attributes to
> indicate what features an object of some class has. The
> example is a class stating it is serializable. This use maps
> to interfaces well. If the object can be dynamic_cast'ed to
> an "ISerializable" interface then you know it provides the
> needed features and you have a way to get them.

I agree with you, but our code base already uses interfaces extensively. There is a need for annotations that interfaces can fill to some extent but which is much more troublesome and much less flexible. One important use is for tools: ideally they don't have instances of the types to work with, and they don't even know the types they're going to work with, it's the types that tell the tools what can be done with them. With interfaces I'd need to modify and recompile my tools for each new interface I create.

The user code further needs to have member types deriving from an interface, even if it just wants a simple double as a member. With introspection and annotations the member can be a double and publish certain things without being a class.

JF Received on Tue Jan 22 2008 - 21:41:28 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 24 2008 - 17:50:01 CET