CDIView and a question if it is possible to make it more generic

Hy Community!

I am new here and also new with the vaadin framework.

For now I’ve got two classes. One abstract class - public abstract class DirectSamplePlanViewContainer extends CssLayout implements View and one class that inherits this class - public class MixingSamplePlanViewContainer extends DirectSamplePlanViewContainer.

Now this inherited class makes this:

@CDIView(value = "LatestMixingSamplePlan", uis = QuickAccessUI.class)
public class MixingSamplePlanViewContainer extends DirectSamplePlanViewContainer {

    private static final long serialVersionUID = 1L;

    @Override
    protected String getQualityRecipeName() {
        return "Mixing - Recipe";
    }
}

So far so good but now I have the problem that I have actually about 20-30 recipe names. I don’t want to make a class for every single one and was curious if it is possible to make it more generic. For example I could imagine to extent the url with an parameter so that it always gives me recipe back with the parameter name. Unfortunately I have no clue how to do that and was curious if you can give me some ideas and hints how to do that or tell me right away that it is not possible to do so.

Already thanks for your help!

I have an example how to process the URL parameters in Vaadin 8 a view here:

https://github.com/TatuLund/cdi-demo/blob/master/src/main/java/org/vaadin/cdidemo/views/main/MainViewImpl.java#L91

Big thank you for helping me.

With your input I could solve my problem and now I understand it way better.

Thx a lot!