For example, if the bank changes the business rule to allow the bank balance to be overdrawn by 2000 dollars, the state of the bank account will be redefined with condition that the balance after withdrawal must not be less than $2000 in deficit. The abstraction of the attribute value is a property of the system, rather than a globally applicable rule. This is because the state of the bank account is changed from positive to negative in technical jargon, a transition from the positive state to the negative state is fired. However, if the account balance would become negative after a withdrawal, the behavior of the withdraw function would be quite different. In such situations, the withdrawals do not affect the abstraction of the attribute values, and hence the gross behavior of the object remains unchanged. The behavior of the withdraw function would be: balance := balance - withdrawAmount provided that the balance after the withdrawal is not less than $0 this is true regardless of how many times you have withdrawn money from the bank. and they are typically used in conjunction with interaction diagrams (usually sequence diagrams).Ĭonsider you have $100,000 in a bank account. State machine diagrams are usually applied to objects but can be applied to any element that has behavior to other entities such as: actors, use cases, methods, subsystems systems and etc. If you want to show control structures like this, you are better off with an activity diagram or indeed with code itself. The rst thing to point out is that this isn’t what sequence dia-grams are good at. An object responds differently to the same event depending on what state it is in. Loops, Conditionals, and the Like A common issue with sequence diagrams is how to show looping and condi-tional behavior. State machine diagram typically are used to describe state-dependent behavior for an object.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |