1 / 37

CS 509 Design of Software Systems

CS 509 Design of Software Systems. Lecture #4 Thursday, Sept. 25, 2003. Class Format for Today. Term Project administration Questions Quiz #2 Review Chapter 2 UML Exercise. Meeting Coordinator Project. Return Phase 1 (Requirements) document Job well done! Grading criteria

mcknightc
Télécharger la présentation

CS 509 Design of Software Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 509Design of Software Systems Lecture #4 Thursday, Sept. 25, 2003 CS 509 - WPI

  2. Class Format for Today • Term Project administration • Questions • Quiz #2 • Review Chapter 2 • UML Exercise CS 509 - WPI

  3. Meeting Coordinator Project • Return Phase 1 (Requirements) document • Job well done! • Grading criteria • Group evaluation forms • No major issues • Is this a worthwhile activity? CS 509 - WPI

  4. Questions? • About Phase 2 • From last week’s class • From the reading • Anything else? CS 509 - WPI

  5. Quiz #2 Choose 5 questions to answer Or answer 6 for extra credit CS 509 - WPI

  6. Chapter 2 – UML Unified Modeling Language CS 509 - WPI

  7. What is UML? • Unified Modeling Language comes from a number of places (see 1st ¶ of Intro., p. 24) • Different notations combined into one standard • Now most commonly used standard in Software Engineering CS 509 - WPI

  8. Why do we need notation? • Ability to articulate complex ideas succinctly & precisely • Conventions provide accuracy & clarity • Leaves less room for misinterpretation & ambiguity CS 509 - WPI

  9. What does notation provide? • Well defined semantics • Well suited for representing a given aspect of a system • Easy to draw by hand • Well understood among project participants CS 509 - WPI

  10. Overview of UML • Subset of UML diagrams covered in book: • Use Case diagrams • Class diagrams • Sequence diagrams • Statechart diagrams • Activity diagrams CS 509 - WPI

  11. ReadTime SetTime WatchUser WatchRepairPerson ChangeBattery Use Case Diagrams SimpleWatch Figure 2-1 (page 25). A UML use case diagram describing the functionality of a simple watch. CS 509 - WPI

  12. Class Diagrams SimpleWatch 1 1 1 1 1 2 1 2 PushButton state push()release() LCDDisplay Battery load() Time now() blinkIdx blinkSeconds() blinkMinutes() blinkHours() stopBlinking() referesh() Figure 2-2 (page 26). An expanded UML class diagram describing the elements of a simple watch CS 509 - WPI

  13. Sequence Diagrams :SimpleWatch :Display :Time :WatchUser pressButton1() blinkHours() pressButton1() blinkMinutes() pressButton2() incrementMinutes() refresh() pressButtons1And2() commitNewTime() stopBlinking() Figure 2-3 (page 27). A UML sequence diagram for a simple watch CS 509 - WPI

  14. Increment Hours Increment Minutes Increment Seconds Statechart Diagrams button2Pressed button1&2Pressed Blink Hours button1Pressed button2Pressed button1&2Pressed Blink Minutes button1Pressed button2Pressed Blink Stop Seconds Blinking Figure 2-4 (page 27). A UML statechart diagram for a simple watch. CS 509 - WPI

  15. Allocate Resources Open Coordinate Archive Incident Resources Incident Document Incident Activity Diagrams Figure 2-5 (page 28). An example of a UML activity diagram. CS 509 - WPI

  16. Modeling Concepts • Systems • Models • Views • Phenomena • Concepts • Abstraction CS 509 - WPI

  17. Systems • Organized set of communicating parts designed for a specific purpose • Parts can be broken down into simpler subsystems • Decomposition is recursively applied to subsystems until we get to objects • Objects are small enough to be fully comprehended without further decomposition CS 509 - WPI

  18. Modeling • Abstraction for dealing with complexity • Complex systems described by >1 model • Each model focuses on a different aspect • What’s interesting, what’s irrelevant? • Depends on what you’re trying to model • Rule of thumb: each entity should contain at most 7  2 parts (Why?) CS 509 - WPI

  19. Modeling Example • Airplane models: • Scale model of exterior surface allows investigation of aerodynamics • Flight simulator models layout & behavior of flight instruments • Both models are less complex than the real life concept (airplane) they represent CS 509 - WPI

  20. * 1 * 1 View System Model depicts describes Views • Decomposition of a model into smaller parts • Focus on a subset of a model to make it more understandable • Views may overlap • Different notations can be used to represent the same view Figure 2-8 (page 31). A System can be described by many different Models, each of which can be depicted by many different Views CS 509 - WPI

  21. Phenomena & Concepts • A Phenomenon is an object as it is perceived in the world • An instance of a concept • A Concept is a generalization (abstraction) for some group of phenomena • Describes properties that are common across a set of phenomena CS 509 - WPI

  22. Concepts & Abstraction • A Concept is defined as a 3-tuple: • Name • Purpose (intent) • Members (extent) • Abstraction: • Classification of phenomena into concepts • Simpler to manipulate & examine (less info) • Irrelevant details are “abstracted away” CS 509 - WPI

  23. Modeling Revisited • Abstractions that can answer specific questions about phenomena • May exist prior to the phenomena it represents • UML model of system not yet implemented • Theory derived from model prior to discovery (black hole, top quark, dark matter, etc.) • Used to communicate about the system • Notation describes model • Views show aspects of model for specific need CS 509 - WPI

  24. More Modeling Concepts • Data Types • Abstract Data Types (ADTs) • Instances, Classes and Inheritance • Abstract Classes • Objects • Events & Messages • Falsification & Prototyping CS 509 - WPI

  25. Data Types • Abstraction in the context of a programming language • Describes a set of instances that share common characteristics: • Name distinguishes it from other data types (e.g. int, char, etc.) • Purpose defines structure & operations valid on all members of the type • Members comprise the extent of the type CS 509 - WPI

  26. Abstract Data Types • Defines a data type at a higher level of abstraction (LinkedList, Stack) • Defines operations & behavior, but not internal structure: • Exposes API only (e.g. push, pop, etc.) • Hides implementation details • Changes to internal representation should not effect use by caller CS 509 - WPI

  27. Instances • An Instance is any member of a specific data type (abstract or not) • Can be manipulated with operations defined by the type • Internal structure may or may not be hidden • A data type is similar to a concept • An instance is similar to a phenomenon CS 509 - WPI

  28. Classes • Abstraction in the context of an object-oriented programming language • Like ADT, encapsulates structure & behavior • Unlike ADT, defined in terms of other classes in an inheritance hierarchy: • Base, Super or Parent class is a generalization • Sub or Child class is a more specific refinement CS 509 - WPI

  29. Inheritance • Classes define operations and attributes that can be applied to instances • Operations/attributes defined in base class are inherited by subclass • Operations/attributes which are defined only in subclass are not accessible in base class CS 509 - WPI

  30. Abstract Classes • Generalization • Purpose is to model shared attributes & behavior • Represents generalized concepts • Never instantiated • Does not correspond to any existing concept • Used to reduce complexity, promote reuse • Examples? CS 509 - WPI

  31. Objects • Instances of a class • Unique identity, stores attribute values (state) • Each object belongs to exactly one class • Instance names are underlined in UML • Distinguish from type/class that defines them • Attributes may not be visible to entire system • Type modifiers specify visibility • Examples? CS 509 - WPI

  32. Events and Messages • Event Class: an abstraction for a kind of event • Event: instance of an Event Class • Can be a Message sent from one object to another • Message: • Usually a request or notification • Name and some arguments • Corresponds to some operation CS 509 - WPI

  33. Object-oriented Modeling • Used in both analysis and design • Analysis focuses on application domain • Represents aspects of the user’s environment • Helps developers understand the problem(s) • Design focuses on solution domain • Richer space of all possible solutions • Changes with technology (Figure 2-14, page 37) CS 509 - WPI

  34. Application Domain Solution Domain Application Domain Model System Model MapDisplay TrafficControl SummaryDisplay FlightPlanDatabase TrafficController Aircraft Airport TrafficControl FlightPlan Figure 2-14. The application domain model represents entities of the environment which are relevant to an air traffic control system (e.g., aircraft, traffic controllers). The system model represents entities that are part of the system (e.g., map display, flight plan database). In object-oriented analysis and design, the application domain model is also part of the system model. An example in this figure is the TrafficControl package that appears in both models. CS 509 - WPI

  35. Falsification and Prototyping • Falsification: • Process of identifying defects in the model • Details missing or incorrectly represented • Model doesn’t correspond to reality • Prototype: • Simulate some aspect of solution (often UI) • Users may falsify prototype • Easier to demonstrate that a model is incorrect than to prove it is correct – why? CS 509 - WPI

  36. UML Exercise – Diagrams Vending Machine Problem • Discussion: define problem • How would you model a vending machine? • What is the process of making a purchase? • Create Diagrams • Which type of diagram • Model some piece of problem • Present to class CS 509 - WPI

  37. For Next Time Chapter 3 Project Communication CS 509 - WPI

More Related