2012/2/10 Emil Lenngren <emil.lenng...@gmail.com>

> So what you want is to extend the array class with some extra methods?
> Just use
> Inherits Person[]
> in the PersonList class ;)
>

Did you read the code and comments?

Not at all. I don't want use inheritance because I won't all methods and
properties from Array[] in the PeopleList interfaz. Hence, I have to use
aggregation (composition, delegation).

If I use inheritance, the clients of PeopleList could do bad things or
things that have no sense (as the case), e.g.

PeopleList.Fill
PeopleList.Push
PeopleList.Pop

This isn't the best example. But if you think about a minute, you will
catch it.

Do not focus on the example, because really, what I want isn't to add to a
class methods from an array (that's just an example). I looking for a
design pattern that allows me to solve a typical problem.

That problem could be described as "How to add methods from a helper object
without have to rewrite a wrapper for each method (with just a call within)
in the host class?".

-- 
Fabián Flores Vadell
www.comoprogramarcongambas.blogspot.com
www.speedbooksargentina.blogspot.com
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to