Should I apply state pattern here? -
I have a panel that draws lots of things, I am using a buffard image to make drawing epiphany So that I have to attract everything, every time something happens.
The content of my color is only for the 'if' statement:
if (! ExtraOnly) // Paint something if paint (listener.getRectangle ()! = Null) // Some colors I like the idea of using the state system, but I'm not sure the right moment to use it? I do not like the idea of setting boolean for extra and maybe I have a pattern fever too. :) Each state will have the same method, Draw (Graphics G)
Since it is in an MVC pattern The visual part of my application is, I'm not even wrong about using state patterns. State should not be part of model and should not be visible?
I do not see anything wrong in the state of view. This is clearly not the same as the state in the model, though.
An example would be a webbrover in this case the model is a web page that is presenting the DOM and browser view DOM in a screen presentation. Scrolling the web page, it is very unable to present the dome on each frame. Obviously a buffer state is of this solution. The state must update only when the underlying DOM changes.
Comments
Post a Comment