Adding an Immutable annotation

4 views
Skip to first unread message

Marco Tedone

unread,
Jan 23, 2011, 1:28:37 PM1/23/11
to jpatterns
Hi all,

I know it's not "officially" a pattern, but why don't we add an
@Immutable annotation, to identify an Immutable class, according to
Item 15 of EJ 2nd Edition?

I'm writing a Twitter services API and would make good use of such
annotation.

Regards,

Marco

Michael Hunger

unread,
Jan 23, 2011, 4:30:42 PM1/23/11
to jpat...@googlegroups.com
So, it is rather an idiom.

Sounds good anyway. Perhaps also add some more of the EJ things? Like Constant Object (== Enum).

Cheers

Michael

> --
> 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.
>

Marco Tedone

unread,
Jan 23, 2011, 6:00:24 PM1/23/11
to jpat...@googlegroups.com
Yep, I was thinking along the same line. Things like Builder, etc. Shall I
create a package called org.jpatterns.ej (with subpackages, such as
immutable, builder, etc)?

If ok pls let me know and I'll add it.

Regards,

Marco

Dr Heinz M. Kabutz

unread,
Jan 24, 2011, 12:37:47 AM1/24/11
to jpat...@googlegroups.com
Hi Marco,

I don't think this is a pattern and I also don't think it belongs in org.jpatterns.  Besides there already is an Immutable annotation in Hibernate AND in the concurrency annotations.

http://groups.google.com/group/jsr-305/browse_thread/thread/fac3b88874aa8b89?pli=1

Probably a lot more places have this.
Regards

Heinz
-- 
Dr Heinz M. Kabutz (PhD CompSci)
Author of "The Java(tm) Specialists' Newsletter"
Sun Java Champion
IEEE Certified Software Development Professional
http://www.javaspecialists.eu
Tel: +30 69 72 850 460
Skype: kabutz 

Johannes Buehler

unread,
Jan 25, 2011, 6:26:02 PM1/25/11
to jpat...@googlegroups.com
I would also not introduce @Immutable. But maybe a @TransferObject matches the pattern you would like to express here.
regards
Johannes

Dr Heinz M. Kabutz

unread,
Jan 26, 2011, 3:53:48 AM1/26/11
to jpat...@googlegroups.com
Right, and that is a recognizable JEE pattern.

Regards

Heinz
-- 
Dr Heinz M. Kabutz (PhD CompSci)
Author of "The Java(tm) Specialists' Newsletter"
Sun Java Champion
IEEE Certified Software Development Professional
http://www.javaspecialists.eu
Tel: +30 69 72 850 460
Skype: kabutz 


Reply all
Reply to author
Forward
0 new messages