I haven't really decided whether the url is going to be an application wide
resources or if it can be set to different values on an instance base. But
does it really make a difference in regards to DI?
The difference is that if you provide the url on an instance basis than your
creation mechanism has to be aware of that url. In other words, all your
DataSource-derived classes need to take a URL at creation time. (They could
ignore it if they don't need it, but it's a code smell.)
If the URL is an app-wide resource, then you can create both
StandardDataSource and HttpDataSource without specifying a URL so they are
effectively the same.
If you have a limited number of URLs to different resources, an option might
be to extend HttpDataSource with, say:
TwitterDataSource
FlickrDataSource
...
These DataSource can then have a parameter-less constructor.
Cheers,
Philippe
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.