Some suggestions

1 view
Skip to first unread message

Nicolas Delsaux

unread,
Nov 10, 2010, 8:38:08 AM11/10/10
to jpatterns
Hi all,
Having done the same thing quite a few time (but to a far lower
extend), let me ask you some questions, and suggest you some
improvements ...

First, a question :
is it planned to have jpatterns available as a maven artifact ? As one
may know, Sonatype offers free access to its OSS repository, making
your artifact available to the crowd of Java developpers for little
effort (see Sonatype doc here for the how-to :
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide).
Unfortnatly, for that, there is an initial step : making jpatterns a
maven project ... but as it seems to already be the case, the step
should not be too high :-)

Second, a testing question :
By reading the doc, I've seen that all your annotations have runtime
retention, making them available in compiled classes (I know you know
that, it's just for the record). As a consequence, could it be
possible to create "patterns tests" ?
As a minimum example, suppose I create a class A using @Singleton. In
that case, i would like to have a "SingletonChecker", that loads all
classes annotated with the @Singleton annotation, and checks that the
getInstance method is really public static, and allows creation of
object. It would also be great to have the same thing for other
patterns, as I think these annotations, although very useful for the
developper at initial -as the convey information on the developper
intent-, may loose their interest after some refactorings.

And now, a reporting question :
Obviously, testing that patterns are well implemented is only a part
of the game. Another part of the game would be to generate some kind
of maven reporting from those, and put it in generated site (I think
it would be at least as useful as some reports already available ...).

Finally, a supporter statement
Don't consider those questions as deffects of your package, as they
are not. Only consider them as the expression of my enthusiasm about
your project, that I will undoubtly integrate in my future - and
present - developments.

marco....@gmail.com

unread,
Nov 10, 2010, 8:50:17 AM11/10/10
to jpat...@googlegroups.com
Dear Nicolas,

I like the idea of making this a Maven project

As regards testing patterns, if for istance we consider the @Singleton pattern there isn't only a way to write singletons. For istance someone might use an Enum (preferred way if you follow effective java) so it becomes hard (and not sure if even sought) to accomodate for every permutation by which a pattern can be implemented.

Regards,

Marco
Sent from my BlackBerry® wireless device
--
You received this message because you are subscribed to the Google Groups "jpatterns" group.
To post to this group, send email to jpat...@googlegroups.com.
To unsubscribe from this group, send email to jpatterns+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jpatterns?hl=en.

Riaan Cornelius

unread,
Nov 10, 2010, 8:53:51 AM11/10/10
to jpat...@googlegroups.com
Hi,

I agree 100% with Marco. As Heinz keeps telling us, they are patterns,
not recipes (I might be paraphrasing a bit here...). My point is that
there isn't necessarily a "right way" as your implementation depends too
much on your specific circumstances.

I would like reporting tools, but that's a nice to have (for me at any
rate) at this stage.

Regards,
Riaan

Nicolas Delsaux

unread,
Nov 10, 2010, 8:56:22 AM11/10/10
to jpat...@googlegroups.com
On Wed, Nov 10, 2010 at 2:50 PM, <marco....@gmail.com> wrote:
Dear Nicolas,

I like the idea of making this a Maven project

As regards testing patterns, if for istance we consider the @Singleton pattern there isn't only a way to write singletons. For istance someone might use an Enum (preferred way if you follow effective java) so it becomes hard (and not sure if even sought) to accomodate for every permutation by which a pattern can be implemented.

In fact, i was not talking about the effective implementation, but rather about the declaration. Concerning the implementation, i'm sure there is some kind of coding-fu in the spirit of well known "project lombok"  or Spring ROO, in order for us to scaffold those concerns.


--
Nicolas Delsaux

Reply all
Reply to author
Forward
0 new messages