[ 
https://issues.apache.org/jira/browse/IMAGING-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260070#comment-14260070
 ] 

Sebb commented on IMAGING-117:
------------------------------

Apart from read-only collections, arrays can be made read-only by providing a 
getter for the individual entries.
Alternatively, the array holder can provide an interface to process entries.

In any case, mutable fields should never be exposed.
Code should always use a getter/setter as that allows synchronisation to be 
easily added.
Even if the getter/setter does not copy the array it provides better 
encapsulation, and allows for changes of implementation without affecting 
callers.

> SofnSegment.components - public mutable array
> ---------------------------------------------
>
>                 Key: IMAGING-117
>                 URL: https://issues.apache.org/jira/browse/IMAGING-117
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Sebb
>            Priority: Blocker
>             Fix For: Patch Needed, 1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to