creation of application-specific classes to a specialized class, the factory. ( The factory is a generic interface defined in the framework and declares a method whose purpose is to create some subclass of a generic class.) Difficulties: patterns are not a solution to all our problems. You can be tempted to insert a pattern randomly when you see an indication which can lead to unwise design decisions. Justify each decision you make. Developing patterns is hard, a poor pattern can be hard to apply correctly. Chapter 8: Modeling interactions and behaviours Help you visualize how the system runs, often built from a use case and a class diagram Elements : instances of classes shown as boxes with classes and objects identified by underline. | Actors: use the stick person symbol | MSGS: shown as arrows from actor to object or object to object Sequence diagrams: objects are arranged horizontaly, actors initating the interaction is often shown on the left. The verticle dimension represents the time, vertical line called a lifeline is attached to each obect or actor, a lifeline becomes a broad box, called an activation box during activation period. A message is represented as an arrow between activation boxes of the sender and receiver. A message is labelled and can have an argument list and a return value. Fragments : Alt: for alternatives with conditions. Multiple operations, separated by dashes OP: optional, to specify a guard condition behavior fragment with no alternative special case of alt. Equivalent to an alt but with two operands. First is save operand of the opt. Second is emptry operand with else guard Loop: May be executed several times. At least executed minimum times and up to maximum count as long as the guard condition is true Par: parallel: concurrency: two or more operands executed in parallel Nested fragments: you can have nested fragments just as you have nested blocks of code State Diagrams : Describes the behavior of a system, some part of a system, or an individual object. At any given point in time, the system or object is in a state. Being in a state means that it will behave in a certain way in response to any event that occurs. Some events will cause the system to change states. In the new state, the system will behave in a different way to events. A state diagram is a directed graph where the nodes are states and the arcs are transitions. At any given point in time, the system is in one state, it will remain in this state until an event occurs that causes it to change states, a state represented by a rounded rectangle containing the name of the table, special state filled in circle is initial, circled circle is end state. Transitions: represents a change of states in response to an event. It is considered to occur instantaneously. The label on each transition is the event that causes change of states. They also have time-outs and conditions Activities: Something that takes place while the system is in a state. It takes a period of time, the system may take a transition out of the state in response to the completion of the activity, some outgoing transitions may result in-the interruption of the activity-or-an early exit from the state.
You've reached the end of your free preview.
Want to read both pages?
- Fall '13
- Object-Oriented Programming