[Simple-support] Add support for unmodifiable collections
Brought to you by:
niallg
|
From: Lumsdon, H. <Hug...@bl...> - 2012-11-14 10:02:05
|
Hi,
I think this has been mentioned, but please can consider adding a really basic framework feature to support un-modifiable collection wrappers using a annotations.
For example:
@ElementList(unmodifiable = true)
private List<xxx> yyyy = new LinkedList<xxx>;
Pretty obvious, but this would make the collection itself immutable (through a Collections.unmodifiableXXX wrapper) once deserialization has completed. We want this feature as we cache and share de-serialized objects and want to restrict developers from doing something stupid i.e. modifying the cached object.
Of course we could wrap the collections manually in a @Commit block (more code to write per object and we have dozens) - or in the getter (wasteful as the wrapper won't get cached) - but it would be much nicer to see this as a framework enhancement.
Thanks,
Hugo.
THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED. If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BlackRock. Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
--
BlackRock Advisors (UK) Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: Drapers Gardens, 12 Throgmorton Avenue, London EC2N 2DL.
|