On Mon, 29 Aug 2016 01:13:01 +0300
Jussi Lahtinen <jussi.lahti...@gmail.com> wrote:

> > It's not unnecessary in fact. Imagine if a children not implement the
> > property... then it's the property in the parent that is readed.
> >
> 
> Yes I know, but in my case it is unnecessary.
> 
But if I understand you correctly then you should be implementing an 
Error.Raise in those empty methods to trap where a child class has not 
re-implemented the property!
> 
> 
> > Another way is to not declare the property in the parent and use an
> > object type to walk the children.
> >
> >
> > Dosometing(hChild as Myclass)
> >
> > dim hObj as Object = hChild
> >
> > try hObj.DoSomethingElse()
> >
> > end
> >
> 
> Thanks for the suggestion. Though, I hope something more elegant...
> 
> 
> 
> Jussi
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user


And another use we have here for those "empty" methods is to implement a 
(hackish) trap to enforce a sort of protection i.e. the implementing child must 
be a particular object type. in other words to prevent say a client program 
calling the root method class directly.

-- 
B Bruen <adamn...@gnail.com (sort of)>

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to