-
Notifications
You must be signed in to change notification settings - Fork 3
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
Paper DX between Porlet-driven and Interface driven approaches #31
Comments
We asked the opinions of developers about different API designs of how to get informed of window state change. The three options are the following.
We asked the opinions of 8 developers. Six people chose the first option and two chose the second. However, two people suggested having an interface including
|
Adding other required methods to the
|
Why string, when you have a WindowState and PortletMode enum? :) |
@tmattsso thanks for your comment. I edited my comment. WindowState and PortletMode are not enums though. They are classes. |
Only thing with the have all features under one class is that we would always need to enable things that all the things need even if not necessary which might cause unnecessary overhead. |
What type of overhead ? Extra roundtrips ? Or ? |
Creating un-needed portal urls (which will need some book keeping). |
Ok. So if we are certain that those are an issue and not premature optimization, what should we do to remedy the situation ? Split into more interfaces ? As long as the API stays the same, we can introduce more interfaces later on without breaking things. |
Well if this suggestion is to remedy the findability then we should go with the context object where you use methods to add handlers as then they would be findable, but we wouldn't have to do anything if nothing is requested from the context. |
In regards to those modes, I kinda have the fear that a user might write something like: public class Something implements PortletListener {
private WindowState currentState;
private PortletMode currentMode;
void windowStateChange(WindowState newState) {
currentState = newState;
refresh();
}
void portletModeChange(PortletMode newMode) {
currentMode = newMode;
refresh();
}
private void refresh() {
if (/* repeat for some permutations of mode and state */) {
}
}
} Those values are (currently) available through |
Closing as the decision has been made and we have moved forward with the "Separate handler interfaces for each status change" approach. A new DX should be conducted was prototype is working |
Gather preference data using paper examples of Vaadin Portlet API. Provide two examples implemented with both Portlet-driven and interface-driven styles. The examples should highlight the portlet API with as little business logic as possible. But the operation context should still be clear. The potential user looking at the example should be able to understand what is the use-case being presented, even if the business logic is missing.
Examples:
Portlet-driven:
Interface-driven:
The text was updated successfully, but these errors were encountered: