[Gambas-user] (no subject)

Fabián Flores Vadell fabianfloresvadell at ...626...
Wed Jun 4 21:26:48 CEST 2014


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.



More information about the User mailing list