From: Johann G. <joh...@gm...> - 2004-10-13 11:35:14
|
> As I see it, these are the reasons for removal of the interfaces. > > 1. Less classes to maintain. With the removal of the classes for the > mutable objects, we have reduced the number of classes per model class > from 3 to 2. It would be nice to reduce it to 1. If a new method is > added, this can be added and documented in one place only. It is easier > to maintain one file than to have to maintain two files and keep them > always in sync. > > 2. It is argued that an interface separates the interface from the > implementation. However, the 'public' keyword does the same thing. A > developer is free to modify any line of code in a class that does not > have the 'public' keyword in it. What is the advantage is duplicating > the public methods in an interface? By using an interface, the plug-in > developer sees only the interface when the developer looks at the > definition of a method. However, I am not sure this is a good thing. > If I look at the definition of a method, I want to see the > implementation. Javadoc can produce documentation that documents only > the public methods. Therefore I see no advantage in duplicating the > public method definitions in an interface. > > 3. Interfaces increase the amount of casting to get the non-public > methods. If code within the same package gets an object then it gets > the interface. If that code wants to access a method with default > (package only) access, then the interface must be cast to the > implementation class (as only the public methods would be in the > interface). I thought about those interfaces again, and I think that we should keep the solution as simple as possible, i.e. remove the interfaces because there is currently no use. One can still re-add them later on if they should be needed. Johann |