Creating custom classes for each java swing component in my application -


i'm working on java swing application. no big graphics. frames , dialogs jcombos, jtexts, jlists etc.. have seen customised jcomboboxes or jtextfields custom functionality specific application. each customised class each type of jcomponent used throughout application. thought - make separate class each component being displayed in application, , handle functionlity associated them in own class... instead of using 1 customised class jcombos in application, thinking of using seaparate class separate jcombos... may require thousands of classes display many number of elements(jcomponents).

for example: if in jdialog have 5jcombos, 3 jtextfields, 2jcheckboxes - planning write 5 custom classes extending jcombobox, 3 custom classes extending jtextfields, 2 custom classes extending jcheckboxes.

is thing do? dont know design patterns , stuff. feasible? have approach been followed already?

i think not idea write class every use case, better generic. used develop swing application tables had specific styles. so, @ time decided use decorator pattern (where added styles, adjustements jtable) , everywhere needed use tables using class. if don't know design patterns, probablby idea go through them time time you'll used them... also, recommend using basic principles: low coupling , high cohesion - in few words: try make class not have many dependencies other resources make code more maintenable , try specific job in class: don't mix different scopes in same class...

this subjective opinion. wish luck!


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -