On 10/20/10 18:17, Taras wrote: >> Sure. All the UI code is in one directory. Multiple classes with >> meaningless names are in one file. > I don't think that all our classes have meaningless names.
No, but many do have names which dont speak for themself. Anyway, for me as java developer the real problem here is multiple classes in one file. >> UI not based on MVC principle. > We have some separation in our code. GTK UI for V, core classes for C and > e.g. history class for M. >> Imho there should be a directory for each "window", with helper classes >> in its own file in the same directory. > Could you please describe more your idea? Lets take reqResViewer.py for example. How i would do it: gtkUi/reqResViewer/reqResViewerUi.py gtkUi/reqResViewer/requestResponsePart.py gtkUi/reqResViewer/requestPart.py gtkUi/reqResViewer/responsePart.py gtkUi/reqResViewer/parentFrame.py A window is a pane/entitiy which could be displayed in his own window, without loss of functionality. Ofc most of the time it would be displayed as tab or component of another window. All additional classes, like models, dialogs for that window etc can be put in that directory too. This improves encapsulation, and imho its easyier to edit multiple files (with tabs and split-window in an IDE) than scroll files with thousands of lines. Ofc, splitting those files and moving them around breaks lots of things, especially svn logs. >> For adding another tab with POST params, i needed to move around a lot >> of code because the authors didnt use encapsulation. > I don't totally agree with it. But we can make some common class for "table > things" > like headers, cookies, post params. Do you talk about such stuff? In Swing, JTable can be given a model. The aquivalent to reqResViewer.py in my project: gui.tab.modyfier.ModyfierTabUi.java gui.tab.modyfier.HeaderUi.java gui.tab.modyfier.HeaderModel.java gui.tab.modyfier.GetParamUi.java gui.tab.modyfier.GetParamModel.java ... ModyfierTabUi just defines the window layout and all UI elements, like the different tabs (get param, header... ), and sets their model's. If i "forgot" post params, i can create PostParamUi.java (which is just a pane with a JTable), PostParamModel.java, (receives actions like "user changed row 3 column 4 to "bla" and translates it to request.setGetParam("arg1", "bla"), add them in ModyfierTabUi and there we go. I see gtk.Table is much much simpler than JTable, so maybe a common table class for such things could be useful. >> I didnt had a look at the proxy feature of w3af, because i use webscarab >> for this sort of things. But first thing i see while trying it out are >> bugs, caused by my patches. It seems like proxywin.py is calling some UI >> code in reqResViewer.py, like "nb.next_page()", which of course does not >> exist anymore. /* no comment */ > I can't find such code in this file in trunk and my branches, > could you please give more information and we will fix it? Oops, true, it was on 1.0-rc3, but not in current trunk or your branch. My fault. regards, Dobin ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ W3af-develop mailing list W3af-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/w3af-develop