We should document clearly that some DMs may not work properly if operations on Sapphire objects have side effects.
From my perspective, side effects are updates to states outside of a Sapphire object. For example, when we call a method on a Sapphire object, this method may make updates on external databases, make updates on other Sapphire objects, or make updates to third party web services. All these updates (either on external databases, on other Sapphire objects, or on third party web services) modify states outside of the original Sapphire object are counted as side effects.
Side effects cause trouble to our DMs. For example, our Transaction DM can rollback the state of a Sapphire object, but it cannot rollback the changes it made to external states (e.g. in databases or other sapphire objects). Similarly, if an operation in a Sapphire object has side effect (e.g. insert one row in database), it will be unsafe for us to inject a Master/Slave DM into this object. Because the replication logic in Master/Slave DM may cause multiple rows being inserted into the database.
We should document clearly that some DMs may not work properly if operations on Sapphire objects have side effects.
From my perspective, side effects are updates to states outside of a Sapphire object. For example, when we call a method on a Sapphire object, this method may make updates on external databases, make updates on other Sapphire objects, or make updates to third party web services. All these updates (either on external databases, on other Sapphire objects, or on third party web services) modify states outside of the original Sapphire object are counted as side effects.
Side effects cause trouble to our DMs. For example, our Transaction DM can rollback the state of a Sapphire object, but it cannot rollback the changes it made to external states (e.g. in databases or other sapphire objects). Similarly, if an operation in a Sapphire object has side effect (e.g. insert one row in database), it will be unsafe for us to inject a Master/Slave DM into this object. Because the replication logic in Master/Slave DM may cause multiple rows being inserted into the database.