Cerberus
Moderator
Web-page
Email
|
posted 2013-10-01 14:47:43 |
Reply -Delete |
The common rule is: restrictions are intended for use mostly with primitive
types, which have no AcceptRule.
In structure, use AcceptRule inside it to stop parsing at early stage (if
only very first fields involved into checking), instead of using
unconditional structures with checking them outside. In this case, of
course, parser will pump all the data and will make calculations only after
that.
You may use restrictions with structures, say, when you have some data
structure with internal rules, and, in some specific place, you need to
check this strcture for some additional conditions.
Restrictions always makes influence on outer structure, to make it invalid
if something is wrong with inner data.
| |