I have a class that goes back to the original page with "go back" and "blue" button The wicket represents But not all pages contain all buttons, e. G. The first page is clearly not "go back".
I think defining a common action handler
Public Interface ActionHandler {void perform (); } and allow those sub-categories to return tasks that they support:
provides the public derivative basic page {Protected ActionHandler GetForwardHandler () {new verb () () {} (two); }}; }} The question is: Why not use protected fields?
Reaches Public Derivative BasicPage {protected forwardHandler = new ActionHandler () {void perform (); }}; } Another option would not be to use heritage (which does not really understand here) and set ActionHandlers from the outside:
Toolbar Toolbar = New Toolbar (); Toolbar. Setter Handler (New ActionHandler) {Zero ({{doIt ();}}); The reason I am not using the interface like forwardhandler and cancel is the handler, that I want to pass the handler in the toolbar, which takes ActionHandlers as parameters. Or do you pass the entire page on the toolbar and the toolbar decides which actions to be displayed based on the applicable interface? Sounds like bad for me OOP
The idea is that each page does not have to define a new toolbar, but it will probably be easy ...
Why not use protected fields? it will work; Sub-classes reassign bus zones to their desire for ActionHandler .
Although I think it is worse than a protected method you are trying to define behavior, and are defined by behavioral methods. With a field, you assign either your initial value to either null or some dummy handler, which leaves the object in a strange situation, where the behavior that is defined internally by that object is fault Can not be omitted from undefined.
Since a protected method is not actually more complex or more code, I think it is appropriate. This can be a default implementation that does not do anything.
I do not know whether it is understandable for content subclasses for their behavior as defined by a collar. If FooPage actually represents page FU, and FU has a definitive behavior, then FooPage should define it.
I do not know whether bad side effects, but to pass something like page autonomy to something, it does not have terrible sound in the theory of deciding its behavior.
Comments
Post a Comment