domain driven design - Using object's setter to trigger data updates, best practices -
I have an object that is installed in the linq in SQL method when the object is being assigned to the field, So I want to check a date field and if it is an old date, retrieve the data from the second table and count it before continuing with specifying this object. Is there something wrong with triggering this kind of incident through property setter or should I independently examine the date through some service and if necessary then should change after some time?
There is nothing wrong with logging from within your satellars, but how much in your satellites Logic should be argued, be careful about it. One of the fundamental problems of the setters is that since they act like features but do support codes, it is easy to forget that there may be some non-trivial action behind the scenes.
You have access to things like this that use the accessories that use the accessories; You can create fast unexpected performance problems. Generally, it is a good idea that the actions of the setters (or gates, for that matter) should be kept in relatively small sets, for example, verification can work perfectly well in a setter, but I usually do Because of things, I advise against verification of external resources: First, problems can arise with the expected speed of resource delay, and secondly, the number of external resources Receive access can destroy your performance.
Generally, the rule is this: Keep it simple It is not inappropriate to do complex things in a setter, but if you do, then it is very important to understand the consequences of all those tasks which You will create, and it is very important that what it does very well, so the next person (or girl) does not just attempt to use the intuitive user to use the code and unexpectedly Eliminates causes of resource contention treated.
Comments
Post a Comment