User loginNavigation |
Fantazies on "final"Yesterday I was playing with unification algorithms and decided to implement one for general Java "terms" (object instances). This naive attempt stopped after 10 minutes when I understood that to make logical variables transparent to user I have to be able to create proxies for objects of any type. Even if I outlaw unboxed types, unfortunately this is not possible also for final classes... Which are expected to form the bulk of typical business objects (they are strings, numbers, ...). This failure caused me to exercise my English in not very creative ways - I understand the original considerations of the JDK standard libraries, but history aside - is it reasonable to even wish to create a dynamic (or for that matter even static) proxy for an instance of a final class? Does not it contradict the semantic of final (that is - not inheritable)? Should not ability to intercept be separated from implementation reuse? PS: lack of proxies for any class is not the only problem for this micro-project - mutability by default instead of having explicit cells kills any chances for transparency of such manipulations in Java - one has to proxy all objects, not just cells and transients. Ironically, both problems are related to word "final" - the first for classes and the second for variables. By Andris Birkmanis at 2004-07-17 16:00 | LtU Forum | previous forum topic | next forum topic | other blogs | 7745 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago