Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #2968
| From | "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Good design and pract |
| Message-ID | <7fnqn3dchrmktofc63s35ml8a5t7tm6hb5@4ax.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <29de809c-7075-4135-94cd-1d71258fa162@l1g2000hsa.googlegroups.com> |
| Date | 2011-04-27 15:42 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui On Thu, 3 Jan 2008 11:34:33 -0800 (PST), jasoncorbett@gmail.com wrote, quoted or indirectly quoted someone who said : > I dislike most gui code I've seen (not that much) because >it appears to me to be a complete mess When I first saw GUI code, for a prototype MacIntosh on the Lisa, I said, "You have got to be kidding. Nobody is going to go to all this fuss for a simple app. I was wrong." It has not improved that much. Some things you can do. 1. Subclass components to put in all your standard tweakings. That way you can change your "style" in one place and reduce the clutter. We need something the equivalent of CSS style sheets for Java GUIs to hide the details of layout and look. That goes much further than just subclassing. 2. use nested panels. 3. separate the allocation and field attributes from the layout. Keep business logic separate from both. 4. make great use of the "extract constant" feature to parameterise your code with named constants. It is a lot easier to maintain a named constant that dig in the code for multiple places to change something. 5. keep your attribute setting methods is a standard order. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Good design and practice "jasoncorbett" <jasoncorbett@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000 Re: Good design and pract "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000 Re: Good design and pract "Karsten Lentzsch" <karsten.lentzsch@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
csiph-web