[Gambas-user] how to override Exec if already inherist from colection (conection pool emulation)

PICCORO McKAY Lenz mckaygerhard at gmail.com
Tue Jul 10 17:10:27 CEST 2018


i see teh observer in the wiki, if i made a observer of any
connection? can cach the exec before ? override it?

see the code at gambas source are in C so override the exec must be like this?

Private Function _exec(query as String) As Resulset
    ' how to obtain the current db object?
    Try super.Open
    ' i must retun a resul set, but then i onvike the super here?
    return super.exec(query)
End

so then, it's that code right?
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com


2018-07-04 10:06 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
> AFAIK that is only way to override anything.
> What is the downside? It's really short code and there isn't practical limit
> for number of classes.
>
>
> Jussi
>
> On Wed, Jul 4, 2018 at 3:33 PM, PICCORO McKAY Lenz <mckaygerhard at gmail.com>
> wrote:
>>
>> 2018-07-03 18:08 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
>>>
>>> Create new class that inherits connection. Do the overriding there and
>>> use the new class instead of the connection class.
>>
>> GRRRRR dgod damn ok ok but then i need to do two inherits in cascade!!!
>> conection->connection2-> and then collection->myclass and in my clkass using
>> the new connection.. seems too many classes  9.9u
>>
>> there-s some way to avoid that?
>>
>>
>>>
>>>
>>>
>>> Jussi
>>>
>>> On Wed, Jul 4, 2018 at 12:59 AM, PICCORO McKAY Lenz
>>> <mckaygerhard at gmail.com> wrote:
>>>>
>>>> i already made my db pool emulation in rudimentary efforts..
>>>>
>>>> my class already inherits from collection, but now i wnats to overrides
>>>> the exec method of each stored connection, how to made it
>>>>
>>>> i attach the project
>>>>
>>>>
>>>>
>>>> Lenz McKAY Gerardo (PICCORO)
>>>> http://qgqlochekone.blogspot.com
>>>>
>>>>
>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>>>
>>>
>>>
>>>
>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>>
>>
>>
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>
>
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>


More information about the User mailing list