<div dir="ltr"><div>No, not forbid it, but control it. Example I may want to trigger some code every time remove is used. And different code when add is used.</div><div><br></div><div><br></div><div>Jussi<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 24, 2019 at 10:27 PM Tobias Boege <<a href="mailto:taboege@gmail.com">taboege@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, 24 Nov 2019, Jussi Lahtinen wrote:<br>
> No, that is the easy part. I mean the _write. How to deal with .remove,<br>
> .add, etc?<br>
> <br>
<br>
By "dealing with it" I assumed you mean "forbid" it. What do you mean?<br>
<br>
If that's the case, just make another copy of the collection that is<br>
assigned to your property in _Write, and give out only copies of that<br>
internal copy. That way, nobody except the object itself can hold a<br>
reference to the collection inside your object and modifications from<br>
the outside are not possible.<br>
<br>
Regards,<br>
Tobi<br>
<br>
-- <br>
"There's an old saying: Don't change anything... ever!" -- Mr. Monk<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div>