Thanks for the reponses Paolo. I'm going back in to reexamine all of the TaskFrame code today. After some tinkering yesterday I realize it is best to proceed with a light hand.
The Sunburned Surveyor On Fri, Jul 4, 2008 at 3:29 AM, P.Rizzi Ag.Mobilità Ambiente <[EMAIL PROTECTED]> wrote: > I never looked at this code, but from you wrote here > I, personally, would leave the interface in place. > > Even if now only the TaskFrame class implements the > Task.TaskNameListener interface who can tell if in > some near or distant future some other class would need to??? > > An interface specify a "behaviour", while a class specifiy a "nature", > and those are two different things. > > Maybe a plugin will need to listen to a Task name and it can do it > by implementing the interface and it's behaviuor. > > If you remove the interface you bound the Task class to the TaskFrame, > so that no other class will ever be able to listen to it, and this is not > good... > > If you really want to remove the interface I suggest you modify the Task > class to accept any Object as a listener. Then it can discover by reflection > if that Object indeed has a taskNameChanged(String argName) method > and it will call it by reflection too. > > Bye > Paolo Rizzi > > >> -----Messaggio originale----- >> Da: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] conto di >> Sunburned Surveyor >> Inviato: giovedì 3 luglio 2008 17.32 >> A: OpenJump develop and use >> Oggetto: [JPP-Devel] The internal Task.TaskNameListener interface is >> notnecessary. >> >> >> See if you can follow this logic. >> >> The Task class declares an internal interface named TaskNameListener. >> This internal interface contains a single methor, >> taskNameChanged(String argName). There is only one class that >> implements this interface, TaskFrame. >> >> However, TaskFrame never uses the String argument from this method. If >> there is a name change the TaskFrame accesses the name from the Task >> it displays directly. >> >> Unless we think there will be other implementations of the >> TaskNameListener in the future, I recommend we remove the >> Task.TaskNameListener interface. It is unecessary "code fat". We >> should do this instead: >> >> - Replace the list of Task.TaskNameListeners in each Task object with >> a list of TaskFrame references. >> - Leave a no-argument taskNameChanged method on the TaskFrame class. >> - When a TaskFrame is being constructed to display a Task, add a >> reference to the TaskFrame to the list of TaskFrames in the Task that >> will be displayed. >> >> This will accomplish the same thing, without the need for the >> TaskNameListener interface and the taskNameChanged(String argName) >> method whose String argument is never used. >> >> The Sunburned Surveyor >> >> -------------------------------------------------------------- >> ----------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel