Hi guys,

I would like to know your feedback on where is the best place to put
helper methods. What I mean by helper methods is like a simple example
below:

public boolean nameIsEquals( Name name, String text )
{
  return text.equals( name.name().get() );
}

With this approach I can just pass anything that has a name and
probably saves a few keystrokes, and avoid silent errors too.
Sometimes I did text.equals( person.name() ) and missed the .get()
part, there is no compilation error. Anyway, this can be avoided if I
write unit test code first.

I am thinking of declaring it in the Name composite itself and provide
a mixin for it. However, I believe there are better ways.

Thank you in advance.

Yours Sincerely,
Kamil.

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to