AW: Dealing with Repository class.
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <32879104985C5A4989420398DEF7543004C703@4flowexsrv.berlin.4flow.de> |
Hi, > What I would prefer to see in BCEL in a lot of these areas > are interfaces > that have several realizations. I'd like to see a > "BCELClass" interface, a > "Repository" interface, an "Attribute" interface, a "ConstantPool" > interface, etc. Then I'd like to see the various forms of > these things > (read in from class, synthetically generated, etc) be different > instantiations of these interfaces. And in general, I would > design things > so that references generally only refer to these interfaces, never to > concrete implementations. (Instantiation obviously has to > happen on the > concrete classes.) > > For example, I would have JavaClass and ClassGen both implement the > "BCELClass" interface, but within BCEL's code, I would only refer to > "BCELClass" so that I'm agnostic to where the class came from. Interfaces are surely a nice abstraction. However, the split between JavaClass and ClassGen was a deliberate design decision. They have of course some things in common, but quite different intentions and semantics. I wouldn't say that's an ideal solution, I just wonder how much "design space" there is for different implementations, since everything is limited by the JVM spec. And you can still subclass of course. Cheers Markus