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

Implement nested-cases #31

Open
sviperll opened this issue Nov 9, 2015 · 0 comments
Open

Implement nested-cases #31

sviperll opened this issue Nov 9, 2015 · 0 comments
Milestone

Comments

@sviperll
Copy link
Owner

sviperll commented Nov 9, 2015

Suppose that you have a class that represents HTTP-endpoints

Like this:

    interface URLVisitor<R> {
        R userIndex();
        R user(int id);
        R postIndex(int userID);
        R post(int postID);
    }

During the application evolution it can be desired to refactor above visitor into nested visitors, like this:

    interface URLVisitor<R> {
        R userIndex();
        UserURLVisitor<R> user(int id);
    }

    interface UserURLVisitor<R> {
        R user();
        R postIndex();
        R post(int id);
    }

We should probably allow such definitions for ADT4J and generate sensible factory and accept methods:

    URL url = URL.factory().user(123).post(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant