Sunday, August 16, 2009

Renderers vs. Factories Moving Ahead

Chen & myself have had a rather engaging debate this past week about moving forward with elaborate components in LWUIT vs. the way components were implemented in Swing and LWUIT in the past.
Both LWUIT and Swing have two types of components those who use renders and those that don't. In Swing all components have a model regardless of whether they have a renderer, however in LWUIT we don't have models for most components due to size constraints (JAR size mostly).

Both of us are generally happy with the design of the current List component, its use of renderers allows us to do amazing things. However, looking at future components built on top of LWUIT we need to decide whether renderers are justified for them or should we limit this approach only for List.

E.g. the tree component from a recent post was built without a renderer but still had a model to produce the data. To determine the appearance of individual nodes a factory method pattern was used. There are several advantages for such an approach as well as several disadvantages which is part of the reason why we are soliciting feedback from you guys who have experience using LWUIT and would like to indicate one way or the other.

No comments:

Post a Comment