有才華的人,別忘記給滋潤你的那塊土壤施肥

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            28 隨筆 :: 5 文章 :: 147 評論 :: 0 Trackbacks

           

        1. You know your target domain or business logic, so that you are able to design expressive and concise domain objects.

        2. You are thinking in "swing models", not the UI-components. If you understand your domain, you probably have an idea as well how to visualize the business concepts in object oriented way. The use of Swing models just becomes natural.

        3. You are starting with the domain objects covered with unit tests, then develop the Swing models - after that the work is almost complete. You "only" have to create the view and pass the model to it.

        4. You are NOT trying to work with the views directly and force them to behave in your way. This could become quite complex, cumbersome and very hard to maintain. E.g. if you are working with the JTable directly, instead of TableModel, even reordering the table columns can cause you some headaches. The are no issues with a custom model in this case.

        5. The use of TableCellRenderers and TableCellEditors in JTables helps you to visualize you domain objects directly - without any overhead.

        6. You are using visual designers like e.g. Matisse in pragmatic way and separate the generated, from your code.

        7. You have a clear concept how to bind (e.g. with reflection+annotations or JSR-295) the UI-components to domain objects and how and where to validate the input (e.g. in controllers, domain objects or converters).

        8. Try to leverage existing JavaBean patterns like PropertyChangeListener, PropertyChangeSupport and the already built-in listeners in the UI-components. There is lot of stuff which can be reused.

        9. If you spend more than half hour to solve a specific "Swing-problem", just stop hacking and use google to find a solution for your problem. There are amazingly good tutorials, articles and posts out there.

        10. If you lose your motivation. Just stop developing Swing, build a quick prototype with SWT/JFace for few hours (but use Tables and Trees). Your motivation should increase dramatically after this experiment :-)
        11.  

          From: Adam Bien's Weblog

          posted on 2008-11-27 11:57 kissjava 閱讀(337) 評論(0)  編輯  收藏 所屬分類: swing
          主站蜘蛛池模板: 香河县| 内乡县| 莱西市| 定兴县| 赣州市| 读书| 绍兴县| 白玉县| 子洲县| 贡山| 铜陵市| 西峡县| 夹江县| 黄平县| 万源市| 东平县| 南充市| 彭山县| 永新县| 孟津县| 万源市| 武陟县| 新巴尔虎右旗| 正蓝旗| 朝阳区| 周至县| 洛阳市| 隆德县| 北海市| 杨浦区| 自治县| 松溪县| 湟源县| 罗源县| 德令哈市| 安泽县| 漳浦县| 通江县| 彝良县| 杂多县| 长子县|