2009/10/1 Krzysztof Białek <[email protected]>:
> Hi,
> I wrote three posts about Qi4j dedicated for absolute beginners.
> You can find them at http://javasnippet.blogspot.com/search/label/qi4j
> Feedback is kindly welcome.
Third post;
As Rickard points out, the @This injection is not needed and the code
end up being;
* No @This Rational state;
01.public Rational add(Rational toAdd) {
02. int n1 = nominator().get();
03. int d1 = denominator().get();
04. int n2 = toAdd.nominator().get();
05. int d2 = toAdd.denominator().get();
06.
07. int d = d1 * d2;
08. int n = n1 * d2 + n2 * d1;
09. return null;
10.}
Further down;
ValueBuilder<rational> builder =
should be capital "R".
And in the summary there is "rather then objects" where it should be
"rather than objects"....
Otherwise, pretty neat, and I wouldn't mind either host it ourselves
or place a prominent link to it.
Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev