router icon indicating copy to clipboard operation
router copied to clipboard

Allow class overriding

Open avargas opened this issue 5 years ago • 2 comments

I wanted to experiment with a subtle behaviour change and stumbled upon a limitation that I could easily fix by extending my own Router. In theory it should be fine, but some methods and instance variables are set to private, when they could be set to protected and allow overriding.

avargas avatar Apr 15 '21 00:04 avargas

No too keen on making all of these protected, as they're internal things that can break things when overridden wrongly. What exactly do you want to achieve?

bramus avatar May 12 '21 08:05 bramus

Well, I wanted to change the behaviour of handle() to do something custom I needed.

While your point is true, my suggestion is that some people might be keen to tweaking behaviour and having fields and methods as private stops this behaviour. I think they should be protected to allow anyone from overriding behaviour, that's the point of it being open source, I think.

avargas avatar May 18 '21 00:05 avargas