Example within documentations of D seriously need some improvement.
Matthew Ong
ongbp at yahoo.com
Fri May 27 10:51:00 PDT 2011
On 5/28/2011 1:24 AM, Jonathan M Davis wrote:
> On 2011-05-27 06:31, Steven Schveighoffer wrote:
> LOL. Yeah. Java will never have operator overloading. That would be on the
> list of features that were considered unsafe. And I know plenty of folks who
> are against operator overloading for similar reasons. Java has a lot of great
> stuff going for it, but it's overly stripped down in terms of features in the
> name of simplicity and safety, and operator overloading is definitely one of
> those that didn't make it in and never will. IIRC, they can't even get
> closures yet, even though it's the feature that's being pushed for the most
> and the Java folks were at least planning on implementing it. They'll never
> get operator overloading.
>
> - Jonathan M Davis
I remember if I am not wrong, C++ can do operator overloading and also
overriding operator that also at child class. Sounded cool, but the more...
you heard that before haven't you... :)
>closures yet
Semi-correct, Not within the standard syntax. But available also.
http://www.codeproject.com/KB/java/lambdajclosure.aspx
Does D have? Perhaps someone may give some URL
http://en.wikipedia.org/wiki/Inversion_of_control
Along side with spring framework?? That allow classes to be late binded
via configuration in xml file.
Implementation techniques
1. using a factory pattern
2. using a service locator pattern
3. using a constructor injection
4. using a setter injection
5. using an interface injection
6. using a contextualized lookup
http://en.wikipedia.org/wiki/Aspect-oriented_programming
using http://en.wikipedia.org/wiki/AspectJ
There are many many extension because I think the bytecode allow such
manipulations and not limited to the standard syntax of Java.
Perhaps something similar can be done with the Object file in D. :)
Yes... I am still a coffee(Java) addict. Sorry cannot stop that. Addict.
May need to take some 12 steps program... :)
--
Matthew Ong
email: ongbp at yahoo.com
More information about the Digitalmars-d
mailing list