Replies: 2 comments
-
A common pattern is to have methods to set up various things, for example with SSDBComboBox there's
in addition there's an I haven't tried, but I'm guessing that if
Something like
With it all specified at once, the build() checks consistency and that all the info has been supplied, and if all looks good then this becomes the current info "atomically", all ready for an I'm not sure this is as useful in ssComboBox (but for consistency?), if it is then the One issue is what to do if there's an error during Then all those setters: setPrimaryKeyColumnName, setQuery, ... go away along with all those firePropertyChange. I need to read about the builder pattern in java, maybe now I'm primed to get it. |
Beta Was this translation helpful? Give feedback.
-
Keeping the old |
Beta Was this translation helpful? Give feedback.
-
(This discussion started in an email thread, I'll adapt them and post after this intro.)
I'm not that familiar with the builder pattern. But after some exposure, and then considering some problems I've recently run into, it occured to me that using a builder can affect
Perhaps I'm being optimistic. (I've discovered that there isn't anything I can't screw up)
Beta Was this translation helpful? Give feedback.
All reactions