Em Tue, 22 Apr 2014 11:50:45 +0200
Benoît Minisini <gam...@users.sourceforge.net> escreveu:

> I have just came back from "holidays", and I haven't read all the 
> pending mails yet.
> 
> I just want to say that if you have problem with Gambas inheritance
> and "SUPER" limitations, you can replace inheritance by "composition".
> 
> I mean : instead of inheriting "Variant[]" or reimplementing it, you
> can create your own "MyVariantArray" class that embeds a Variant
> array as a private dynamic variable. Then you will be able to do
> almost everything you need.

Indeed, "composition" is the best option given the current situation.
Wise advice.  Correct if I'm wrong, but I think that is best exploited
when using '_unknown' and '_property' special methods to
transparently deliver any method or property request directly to the
private dynamic array.  This way one don't have to wrap every possible
array method or property and the class can be made agnostic of array
type.

> Another point: It's not a good idea to reimplement native array
> classes. These classes must be as fast as possible, they are used
> everywhere. I don't think that you need an "Update" event for every
> array in your application, do you?

No, I don't.  It's a very specific use case.


Thank you.
Happy Hacking!


--
 ,= ,-_-. =.  Bruno Félix Rezende Ribeiro (oitofelix) [0x28D618AF]
((_/)o o(\_)) There is no system but GNU;
 `-'(. .)`-'  GNU Linux-Libre is one of its official kernels;
     \_/      All software must be free as in freedom;

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to