110 likes | 126 Views
Learn about defining classes, attributes, methods, and dynamic behavior in software systems through various modeling tools.
E N D
Dynamic Modeling: Defining Classes B.Ramamurthy B.Ramamurthy
Introduction • (User) Requirement Analysis was done using Use Case Model. Result of this phase is a Use Case Diagram(s). • Further analysis involves using the use cases to discover classes and relationship among them. Result of this phase is a class diagram(s). • Next the classes need to be defined: the attributes, the methods and dynamics of the interaction among the classes.Dynamic Model expresses the dynamic behavior of objects of class and the interaction among objects during the execution of a system. • Dynamic Modeling Tools are: Collaboration diagram, state diagram, sequence diagram and activity diagram. B.Ramamurthy
Topics for Discussion • Revisit Weather Station analysis. • Other class diagrams from Lab2. • Class definition. • Interface, Abstract Class, Concrete Class. • Sequence Diagrams: describe how objects interact and communicate with each other. Primary focus here is time. • Collaboration Diagrams: describe how objects interact but the focus is on space. • Activity Diagrams: yet another way of showing interaction but with focus on activities. • Since Sequence, Collaboration, and Activity diagrams all show interaction, you must make a choice as what you want to use in your practice. • State Diagrams: describe which states an object can have during its life cycle, behavior in those states, and along with events that bring about state transitions. • We will study Sequence Diagrams and State Diagrams. B.Ramamurthy
Class Definition • Class name • Class attributes/characteristics/properties/data • Class operations/capabilities/behaviors/methods • Types of methods: • Constructor(s) • Destructor • Service methods • Get/set methods • Utility methods • Predicate methods B.Ramamurthy
Sequence Diagrams • Sequence diagrams illustrate how objects interact with each other. • They focus on message sequences. • Objects interact by sending messages that invoke operations specified by the objects receiving the messages. • Two axes: vertical axes shows time, horizontal access shows objects. B.Ramamurthy
Message Types and Notation (UML) Synchronous Message (call) Asynchronous Message (interrupt) Simple Message (passing of control Flow) Message Return Note: Rational Rose Demo tool provides just one type of arrow head for all the messages. B.Ramamurthy
Components of a Sequence Diagram An object which is an instance of class Manager An object Dan which is an instance of class Manager An Object Dan, the Manager is sending a message to Sue, the Employee to contactClient(); contactClient() is a method of Employee class. B.Ramamurthy
Job Application: Class Diagram B.Ramamurthy
Job Application: Sequence Diagram B.Ramamurthy
State Diagram • Defines the semantics of a class or operations within an object. • Basic components: Initial State, Final State, intermediate state, state transition and associated labels. • All objects have a state which is a result of previous activities performed by the object. B.Ramamurthy
Matrix of Diagrams Use Case Component Sequence Collabortn. Deployment Package State CRC Class Activity Analysis System Design Class Design Physical Architecture B.Ramamurthy