lmassand wrote:When I try to open the Mail project (provided in GWT samples) Mail.java in the design view I get the following error
Give this a try with the latest v2.0.1
build. We made a few tweaks to address some of the problems specific to that example.
lmassand wrote:Pls help me in resolving this issue as I need to take decision whether using Designer will help me save time and at the same time provide flexibility.
Whether Designer can or can't open that example shouldn't make any difference. You should give the tool a try yourself and put it through its paces (maybe even run throug the tutorial). We only gurantee that GWT Designer will be able to edit code that it creates itself. The product does pretty well with hand written or refactored code, but we make no claims that it will handle all
hand written GWT code out there...especially questionable code like the Mail
example. The Mail
example has several issues that need to be addressed before I would ever recommend using it as an example of how to write good GWT code or good Java code in general.
For example, the MailList
class sends a get()
call to the Mail
class to access its singleton without testing that it is non null or ensuring that the singleton is actually created. The get()
method itself returns the singleton field without ensuring that it is populated. The example relies on runtime-specific behavior to populate the singleton instance (the call to the Mail.onLoadModule()
method). When editing the Mail
class at design time, there is no instance of the Mail
class created. The Mail
class is parsed; it is not instantiated. Any code that tries to actually access the instance of the class being edited will not work because there is no such instance.
From a purely OO point of view, the Mail
example is also poorly designed. The classes are tightly coupled (when they don't need to be) and the MailList
class unnecessarily breaks encapsulation by talking directly back to the Mail
class via its singleton.