V
V
Vitaly2017-01-18 21:19:24
Programming
Vitaly, 2017-01-18 21:19:24

What if the value fails the check in the setter?

Interested in best practices. Example: there is an object, it has a string property into which non-empty strings can be written.
What if the value does not satisfy the condition? Throw an exception? Silently disable assignment? Adjust with default value?
Related articles:
java, c#
javascript
action script

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question