Should I split a data class from its' java swing gui? -


hello people of internet. i'm in situation need create gui create objects of various classes , want in generic way. more specific, whole concept create various products shop. example, product categories notebooks , pens. after selecting product category list, form jframe window appear user prompted give more specifics product.

however, not products require same data. let's assume have notebook class requiring page number integer, , pen class requiring pen color string. obviously, need handle creation of window differently each product type.

so question is, should handle creation of window? ok create method in each data class creates complete jframe of form required, or should handle gui seperately data classes?

thanks in advance!

you not want have guis interwoven classes. idea @ mvc. model-view-controller.

the idea gui seperated model, controller inbetween of them deals moving data , gui. there 2 common variants of this, either let model notify view has new data available, or model pings controller again , controller notifies view of new data.

this architecture pattern. provide solutions commonly occuring problems in software engineering, , it's idea read on them :-)


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -