CS 501: Software EngineeringAdministrationThe Waterfall ModelProgram DesignThe Importance of ModelingPrinciples of ModelingThe Unified Modeling LanguageUseful TextsRational RoseDiagrams in UMLDiagrams in UML (continued)Slide 12ClassClass DiagramsThe "Hello, World" ExampleThe HelloWorld ExampleAnnotationAbstraction for HelloWorldNotation: RelationshipsRelationshipsNotation: Relationships (continued)GeneralizationNotation: InterfaceClass Inheritance DiagramModeling ClassesNoun Identification: A Library ExampleSlide 27Candidate ClassesRelations between ClassesOperationsClass DiagramRough Sketch: Wholesale SystemSlide 33Slide 34Expanding a Class: Modeling Financial InformationModeling InvoiceLessons LearnedLevels of AbstractionNotation: GroupingPackaging Classes1CS 501 Spring 2003CS 501: Software EngineeringLecture 17Object Oriented Design I2CS 501 Spring 2003AdministrationNew syllabusQuiz 4 on Thursday, April 3 (no lecture)Lecture 23 on Wednesday April 16 (evening)Second presentation and report next weekSign up. Assignment will be posted shortlyQuiz 3Collect after class3CS 501 Spring 2003The Waterfall ModelRequirements AnalysisSystem designUnit & Integration TestingSystem TestingOperation & MaintenanceProgram designCodingAcceptance TestingRequirementsDesignImplementation4CS 501 Spring 2003Program DesignThe task of program design is to represent the software system functions in a form that can be transformed into one or more executable programs.Given a system architecture, the program design specifies:•computers and networks•programs, components, packages, classes and class hierarchies•interfaces, protocols•security mechanisms, operational procedures5CS 501 Spring 2003The Importance of Modeling• A model is a simplification of reality.• We build models so that we can better understand the system we are developing.• We build models of complex system because we cannot comprehend such a system in its entirety.Models can be informal or formal. The more complex the project the more valuable a formal model becomes.BRJ6CS 501 Spring 2003Principles of Modeling• The choice of what models to create has a profound influence on how a problem is attacked and how a solution is shaped. • Every model can be expressed at different levels of precision.• The best models are connected to reality.• No single model is sufficient. Every nontrivial system is best approached through a small set of nearly independent models.BRJ7CS 501 Spring 2003The Unified Modeling LanguageUML is a standard language for modeling software systems• Serves as a bridge between the requirements specification and the implementation.• Provides a means to specify and document the design of a software system.• Is process and programming language independent.• Is particularly suited to object-oriented program development.8CS 501 Spring 2003Useful TextsGrady Booch, James Rumbaugh, Ivar Jacobson, The Unified Modeling Language. Addison-Wesley 1999.Grady Booch, Object-Oriented Analysis and Design with Applications, second edition. Benjamin/Cummings 1994.Rob Pooley, Perdita Stevens, Using UML Software Engineering with Objects and Components. Addison-Wesley 1999.9CS 501 Spring 2003Rational RoseRational Rose is a system for creating and managing UML diagrams.It is available for all Computer Science Department computers, but you may have to install it.See: http://adm/Software/purify_install.htm for installation instructions.See: http://www.rational.com/products/index.jsp for information about the system.10CS 501 Spring 2003Diagrams in UMLA diagram is the graphical representation of a set of elements, usually rendered as a connected graph of vertices (things) and arcs (relationships).• Class diagram shows a set of classes, interfaces, and collaborations with their relationships.• Object diagram shows a set of objects and their relationships.• Use case diagram shows a set of use cases and actors (a special kind of class) and their relationships.11CS 501 Spring 2003Diagrams in UML (continued)Interaction diagram shows an interaction, consisting of a set of objects and the relationships, including the messages that may be dispatched among them. => A sequence diagram emphasizes the time ordering. => A collaboration diagram emphasizes the structural organization of the objects that send and receive messages.12CS 501 Spring 2003Diagrams in UML (continued)• Statechart diagram shows a state machine consisting of states, transitions, events, and activities.• Activity diagram is a statechart diagram that shows the flow from activity to activity within a system.• Component diagram shows the organization and dependencies among a set of components.• Deployment diagram shows the configuration of processing nodes and the components that live on them.13CS 501 Spring 2003Class Windoworiginsizeopen()close()move()display()nameattributesoperationsA class is a description of a set of objects that share the same attributes, operations, relationships and semantics.14CS 501 Spring 2003Class Diagrams Windoworiginsizeopen()close()move()display()nameattributesoperationsA class is a description of a set of objects that share the same attributes, operations, relationships and semantics.15CS 501 Spring 2003The "Hello, World" Exampleimport java.awt.Graphics;class HelloWorld extends java.applet.Applet { public void paint (Graphics g) { g.drawString ("Hello, World!", 10, 10); }}Example from: BJR16CS 501 Spring 2003The HelloWorld ExampleHelloWorldpaint()classnameoperations17CS 501 Spring 2003Annotationreturn copy of selfA note is a symbol for rendering constraints and comments attached to an element or a collection of elements.18CS 501 Spring 2003Abstraction for HelloWorldHelloWorldpaint()g.drawString ("HelloWorld", 0, 10)"classnameoperationsannotation19CS 501 Spring 2003Notation: RelationshipsA dependency is a semantic relationship between two things in which a change to one may effect the semantics of the other.0..1 *employer employeeAn association is a structural relationship that describes a set of links, a link being a connection among objects.20CS 501 Spring 2003RelationshipsParkingParking Spacelocationis_available()10 ... 121CS 501 Spring 2003Notation: Relationships (continued)A generalization is a specialization/generalization relationship is which objects of the specialized element (child) are
View Full Document