View naming in Navigator API could be more 'statically typed'
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by @emarc
In the new Navigator API, Views are registered using a string, and the API does not help in handling these. This is not ideal.
However, it's not clear how the problem could be adressed; the fragment will obviously always be a String.
One convenient practice is to add a static to each View: MyView.NAME, but this can't be APIfied.
Adding View.getViewName() would remove the need to tell the Navigator explicitly when adding instances, i.e navigator.addView(new MyView()), but would not work when adding classes as navigator.addView("name", MyView.class). One possibility is to provide all of addView(View), addView(String, View), addView(String, Class), where the latter two would 'override' getViewName() - this might be overly complex, though.
Imported from https://dev.vaadin.com/ issue #9057
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the Navigator API and its existing addView overloads, especially the string- and class-based registration described in the issue. Determine and agree on a naming approach for view instances and classes; done means the API design is decided and consistently specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100