Hi folks.

I'm trying to implement a "decoration chain", but until now I can't get
success.

Let me explain the problem in detail.

I have a class C, that is decorated by the class B, that is decorated by
the class A. So, from the point of view of the client class, the class A
must respond to messages from both, class B and class C.

The decoration is implemented by delegation, not by inheritance. Besides,
in some cases a class A must call just some messages belonging to class B,
and the same respect the class C.

I found relatively easy to do this using the special methods _property and
_unknown, but only when the relation involves two classes and restricting
to just properties or methods (not both).

Someone, knows how this can be achieved in Gambas?

If not, (to Benoit and dev team) would be possible to add a feature to
Gambas in order to do the implementation of decoration patterns easier?

I know, I know, is perfectly possible to do this in Gambas by writing the
appropiate wrappers for those desired methods and properties belonging to
other classes. The point is: this kind of code is boring to write,
bothering at code reading time, and inconvenient for prototyping.

SFMBE.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to