While it would cut down on the amount of line noise in the code, I see this 
as being somewhat fragile and I would avoid it in my code.  Introducing a 
dependency between your code structure and your CSS would make it much more 
difficult to change things and refactor without breaking.  I tend to hate 
anything that makes refactoring difficult, as I find the maintenance phase 
of an application is by far the lengthiest part.

We actually did something similar to this in our codebase.  We had CSS names 
auto-generating from the class name of the view/widget.  While it did reduce 
some line noise, I found out that it made refactoring break all of the CSS.  
This made me not want to refactor things, which is evil.  I've almost gotten 
rid of all of it by now, and will never go back.

My current way of reducing this overhead is a simple Widget factory object.

VerticalPanel mainPanel = new 
WidgetUtility().createVerticalPanel("cssClassOne");

Not really auto-generated or anything, but it cleans up the code, and 
doesn't rely on any magic.

-Ben

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to