12 Apr 2005 21:54
more flexible Factory interface
<Forum <at> carlsbadcubes.com>
2005-04-12 19:54:37 GMT
2005-04-12 19:54:37 GMT
Hello, we started porting our application to swixml. So far it works just great. We haven't encountered any serious problems. Thank you for great tool. May I make some proposals concerning code improvements. There is a method Parser.addChild(..). Why can't we introduce addChild method in Factory interface like this /** * <at> param parent component returned by newInstance method * <at> param child child component * <at> param index index of child as it appears in xml file * <at> param attributes child's attributes specified in xml */ void addChild(Object parent, Object child, int index, List attributes); then we could have different factories for specific containers like JMenuBar, JScrollPane etc. What advantages does it give to us. 1. it makes code more object oriented by avoiding long if .. else if .. block in Parser.addChild method. 2. It would allow users to create their own custom gui containers and incorporate them into swixml by creating custom factories and overriding addChild method.(Continue reading)
RSS Feed