Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Private methods and properties to Protected to use Japa classes as Base classes #48

Closed
mikesaintsg opened this issue Feb 7, 2022 · 2 comments
Assignees
Labels
Type: Question Needs clarification

Comments

@mikesaintsg
Copy link

Version 5.0.17-0

First things first, I love the new version, this package is headed in the right direction and look forward to it getting even better!

I'm working on my own version of the Vow test runner for AdonisJS since it hasn't been ported over for version 5.

I would like to have the freedom to build on top of the Japa classes by extending them on my own custom classes.
Problem is that most of methods and properties are private instead of protected, so they can't be overridden or accessed, even when they are extended.
It makes the custom classes unwieldy trying to find ways around that with a bunch of extra clutter.

Since the idea of Japa is to build on top of it, it would make sense for the class to be extendible with the methods and properties available for the developer to override and access.

Of course, there's a time and place for private methods and properties, but closer to the end user.

Thanks!

@mikesaintsg mikesaintsg changed the title Private methods and properties changed to Protected to extends Change Private methods and properties to Protected to use Japa classes as Base classes Feb 7, 2022
@thetutlage
Copy link
Collaborator

Agree. Yes, a lot of methods can be protected over private. I usually design APIs with restrictive boundaries and then open up the APIs as needed.

Do you have any use case in mind where you wanted to access some property and it turned out to be private?

@thetutlage thetutlage added the Type: Question Needs clarification label Feb 8, 2022
@thetutlage thetutlage self-assigned this Feb 8, 2022
@thetutlage
Copy link
Collaborator

Closing since no response from the issue reporter and not actionable as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Needs clarification
Projects
None yet
Development

No branches or pull requests

2 participants