Sign in or Join FriendFeed
FriendFeed is the easiest way to share online. Learn more »
Chris Wetherell
"So I'm in Java. I guess I start by writing an AbstractBaseRepresentationClass and go from there?"
No. Start from an AbstractBaseRepresentationClassFactory. - Private Sanjeev
Or you could do what we all did before the Java "community" went apeshit will all that stuff, and write the same kinds of classes you would if you were sitting down to write Python or whatever :) - Joel Webber
I barely use classes with Python any more, closures are much nicer. - Jim Norris
Like inverse CLOS? :-) - Daniel Dulitz
I haven't actually had the pleasure of using CLOS, but probably something like that. Maybe I use python more like scheme than CLOS. - Jim Norris
Note however, the AbstractBaseRepresentationClassFactory (which should better be an interface - then you can have a AbstractBaseRepresentationClassFactoryImplementation) needs to be provided by a dependency injection framework configured with some XML configuraiton file that is partially generated from annotations in Java classes; done so via some custom ant-task. - Henner Zeller
Henner, I think you're exaggerating the verbosity of java; it could clearly be named AbstractBaseRepresentationClassFactoryImpl - Karl Rosaen
It's so sad that this caricature of Java rings true, because the architecture-astronaut crowd seems to have taken over. We need more people thinking like these guys: http://www.playframework.org/ - Joel Webber
Joel, I agree it's easy to make fun of java by finding some straw man BeanSerializerFactoryConfiguratorImpl out there and pointing and laughing, but I do think there is a tension between reusability and over design / verbosity in java since you need to depend on interfaces for your class to be reusable whereas in python or javascript, the duck typing means anything you plug in that will work just works without it having to implement an interface. - Karl Rosaen
Aren't there ways of introducing prototypal inheritance to Java now? - Jason Wehmhoener
@Karl: Agreed that Java's inheritance model (like C++'s, though at times even worse) sometimes causes people to over-design a bit. But I don't think it's anywhere near as difficult to write simple, sensible Java code as these examples would imply -- I think it has more to do with archinauts (?) finding that it's so easy to write lots of code in Java that they simply do so without considering how silly and baroque it all gets. - Joel Webber
What I do object to is the notion that I have to jump to a dynamic language to fix these problems (not obviously espoused on this thread, but on plenty of others). I want good tools, and I want a language that has a hope in hell of being optimized, and no truly dynamic language can give me either. Anyone notice that the Closure Compiler essentially defines a statically typed version of Javascript? They had to, because there's just no way to safely optimize it otherwise. I'm not willing to give up speed for a programming paradigm. - Joel Webber
The downside of duck typing though is that in a large program, for a given callsite, you don't really know what methods are available unless you know the 'greatest common duck', I find this really makes code navigation on code bases you didn't write painful. - Ray Cromwell
Funny: For various reasons I'm having to bang on some Python code I didn't write. It's such a freaking nightmare trying to figure out why it's blowing up all the time, usually because I misunderstood what properties were supposed to be available on an object, or what type a parameter is, or whatever. "Who calls this method" is a pretty damned hard question to ask of a Python code base. So is "are there any syntax errors in my code". Bah :P - Joel Webber
I'm eager to see if Go might bridge the chasm. Sound-but-lithe would be ideal in a type system. - Bruce Johnson from BuddyFeed