这是不是属于singleton模式的一种呀
public interface UserLogin extends RemoteService {
public static final String SERVICE_URL = "/Login";
public static class Util {
public static UserLoginAsync getInstance() {
UserLoginAsync instance = (UserLoginAsync)GWT.create(UserLogin.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URL);
return instance;
}
}
public boolean MyLogin(String username,String password);
}
代码如上。 做的是一个GWT项目的远程借口。 里面的静态类是不是就类似于一个静态工厂呀.
还有写在interface里的类有什么特点,这种写法我见的很少呀