[progress Communities] [progress Openedge Abl] Forum Post: Re: Immutable Objects

  • Thread starter Thread starter Thomas Mercer-Hursh
  • Start date Start date
Status
Not open for further replies.
T

Thomas Mercer-Hursh

Guest
I'm wondering a bit why you are focused on immutability as a concept. It seems to me that a particular type of object has certain behavior. If that behavior includes only read-only requirements, then it is provided only with read only methods, although that implies setting through the constructor, which I am not nuts about unless it is very simple. If it needs both read and write methods, but it should only be writeable up to some point where it becomes read only, like a Client Principal, the provide a switch which disables the write methods once the switch is thrown. If that is true for outside users, but not for the creator, then provide a key protected method for flipping the switch back. I.e., the object needs to have whatever behavior it needs to have and you need to provide methods which implement that behavior and not provide any other methods which do something not in the behavior set.

Continue reading...
 
Status
Not open for further replies.
Back
Top