Re: Update of properties
Dan Tihelka <[email protected]>
| Newsgroups | gmane.comp.java.cruise-control.user |
|---|---|
| Message-ID | <[email protected]> |
Hallo jeffrey,
May I have one suggestion about setFileResolver(FileResolver) method
implemented by plugins which want to register files through the resolver?
You have written:
> and then pass the file resolver into the ProjectXMLHelper which in turn
would pass it (via reflection) to plugins that have the method:
>
> public void setFileResolver(FileResolver)
Instead of reflection, could it be better to create an interface:
public interface WantFileResolver /* You may suggest a better name ... */
{
public void setFileResolver(FileResolver)
}
and each plugin interested in it would implement the interface? I think that
it has several advantages compared to the reflection:
- easier to test, just:
if (pluginInstance instanceof FileResolver) {
}
is enough
- easier to document for "3rd party" plugins - there is explicitly said what
the implementing class requires, while when just reflection is used, the
meaning is little bit hidden ...
- easier for changes - if the signature of the method changes for any reason,
the list of classes to correct is determined by build error and you do not
forget to change all of them (also good for "3rd party" plugins)
What do you think?
Dan T.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user