1COMP5028 Object-Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 1 Introduction History of OO Week 1 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 2 Administrative n Instructor q Dr. Ying ZHOU (zhouy@it.usyd.edu.au) q Office: Madsen G89 q Consultation: Wednesday 4-5pm n Lectures q Wednesday 6-8pm Eastern Avenue Seminar Room 404 n Labs q Wednesday 8-9 StorieDixson 432A n Course Website: q http://www.cs.usyd.edu.au/~comp5028 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 3 Objectives n Learn O-O A&D methodology n Understand why a methodology is useful for real software projects n Learn UML n Learn O-O design patterns n Build something that illustrates the concepts 26-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 4 Course Outline n 4 Major parts of the content q Introduction (2 weeks) q Object Oriented Analysis (4 weeks) n Requirement discovery (week 3) n Requirement Analysis (week 4) n System behavior (week 5) n Object Interaction (week 6) q Object Oriented Design (5 weeks) n Design Principles q Advanced Topics (2 weeks) 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 5 Course Outline (cont) q Object Oriented Design (5 weeks) n Design Principles (week 7) n Design models (week 8) n GoF design patterns I (week 9) n GoF design patterns II (week 10) n System design (week 11) q Advanced Topics (2 weeks) n XML and Web services (week 12) n Course Revision (week 13) 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 6 Assessment Components n Two individual assignments q Assignment 1 (20%) n System analysis n Due on week 7 q Assignment 2 (20%) n System design and implementation n Due on week 12 n Final Exam (60%) q Closed book 36-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 7 Books n Recommended textbook q Craig Larman, Applying UML and Patterns: An Introduction to Object- Oriented Analysis and Design and the Unified Process, 2nd edition, Prentice Hall PTR, 2002 n Reference books: q Bernd Bruegge, Allen H Dutoit, Object-Oriented Software Engineering: Using UML, Patterns and Java, 2nd Edition, Prentice Hall PTR, 2003 q Martin Fowler, UML Distilled, 3rd edition, Addison-Wesley, 2004 q Robert C. Martin, Agile Software Development: Principles, Patterns and Practices , Prentice Hall, 2003 q Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides , Design Patterns, Addison-Wesley, 1995 q Bernd Oestereich, Developing Software with UML: Object-Oriented Analysis and Design in Practice , 2nd edition, Addison-Wesley, 2002 q MeilirPage-Jones, Fundamentals of Object-Oriented Design in UML, Addison-Wesley, 2000 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 8 Software n Rational Rose Enterprise Edition q Licensed software q Installed on the lab n ArgoUML q Open source software q Which you can install and play with at home 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 9 Rule of Conducts n Okay to discuss ideas and problem approaches n All work must be your own creation n Plagiarism will not be tolerated under any circumstance! n What is plagiarism q Copying all or part of another student ’s work (with or without their knowledge) q Using another person’s ideas without acknowledgement q Obtaining material (code or other) from the web or a book and passing it off as your own 46-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 10 Today’s lecture topic n Brief History of Object-Orientation q Where did Object-Orientation Come From? q What’s Object-Orientation Good For? q What is OOAD? q What is UML? 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 11 Where does OO come from n Larry Constantine [1960s] q One of the first people suggested that software could be designed before it was programmed n O.-J Dahl and K.Nygarrd [1960s] q Supplied several ideas that are now part of object-orientation n Alan Kay, Adele Goldberg, and others [1970] q Developed the first version of Smalltalk language at the Xerox Palo Alto Research Center q Gave us many of the concepts that we now consider central to object-orientation 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 12 Where does OO come from? (cont) n Edsger Dijkstra [1970s] q Proposed the ideas of building software in layers of abstraction with strict semantic separation between successive layers n Barbara Liskov [1970s] q Theory and implementation of ADT n David Parnas [1970s] q Principles of good modular software construction n Jean Ichbiah and others [1980s] q Ada language adopted by US DOD 56-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 13 Where does OO come from (cont) n Bjarne Stroustrup[1990s] q The genealogy of C++ language n Bertrand Meyer[1990s] q Melding of the best ideas of computer science with the best ideas of object orientation q Eiffel n Grandy Booch, Ivar Jacobson, and Jim Rumbaugh [1990s] q The Three Armigos q Unified Modeling Language (UML) 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 14 What’s Object Orientation good for? n Good for nothing? n Merely a religious cult? n Global conspiracy based somewhere on the West Coast? n The first and only miracle solution to all our software woes? 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 15 What’s OO good for? (cont) n Analyzing user’s requirements q “Dynamic and static analysis” instead of “process and data analysis” n Designing software q Boon n Hide software eyesores as: convoluted data structures, complex combination logic, sophisticated algorithms and ugly device drivers q Bane n The structures that it employs (like encapsulation and inheritance) may themselves become complex 66-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 16 What is OO good for (cont) n Constructing software q Reusability q Reliability q Robustness q Extensibility q Distributability q Storability 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 17 What’s OO good for? n Maintaining software n Using software q GUIs are often implemented through object orientation n Managing software projects 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 18 What is Analysis and Design n Analysis emphasizes an investigation of the problem rather than how a solution is defined n Design emphasizes a logical solution, how the system fulfills the requirements 76-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 19 Analysis and Design (cont) n Division between A & D is fuzzy n A & D activities exist on a continuum n Some practitioners can classify an activity as analysis while others put it into design category More analysis oriented More design oriented -what -requirements -investigation of domain -understanding of problem -how -logical solution -understanding and description of solution 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 20 What is O-O A&D? n The essence of O-O A&D is to consider a problem domain and logical solution from the perspective of objects (things, concepts, or entities) n O-O Analysisemphasizes finding and describing the objects – or concepts- in the problem domain n O-O Design emphasizes defining logical software objects (things, concepts, or entities) that have attributes and methods 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 21 Object vs. Function Oriented Analysis Library Info System O-O A&D Decompose by objects and concepts Structured A&D Decompose by functions and processes Catalog Librarian Book Library System Record Loans Add Resource Report Fines 86-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 22 Unified Modeling Language n “A language for specifying, visualizing and constructing the artifacts of software system ” [Booch, Jacobson, Rumbaugh] n It is a notational system aimed at modeling systems using O-O concepts n … not a methodology n … not a process 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 23 Ways of using the UML n UML as sketch q Forward engineering q Reverse engineering n UML as blueprint q CASE tools n UML as programming language 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 24 UML diagrams (as of version 1.5) n Use case diagram n Class diagram n Behavior diagrams: q statechart diagram q activity diagram q interaction diagrams: n Sequence diagram n Collaboration diagram n Implementation diagrams: q component diagram q deployment diagram 96-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 25 What is legal UML? n Legal UML is what is defined as well formed in the specification n Prescriptive rules q A language with prescriptive rules is controlled by an official body that states what is or isn’t legal in the language and what meaning you give to utterances in that language n Descriptive rules q A language with descriptive rules is one which you understand its rules by looking at how people use the language in practice 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 26 Iterative and Waterfall Processes n Waterfall q Breaks down a project based on activities n Iterative (incremental, spiral, evolutionary…) q Breaks down a project by subsets of functionalities q Each iteration produces tested, integrated code 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 27 Fitting the UML into a Process n Requirement analysis q Use cases – describe how people interact with the system q A class diagram from the conceptual perspective q An activity diagram q A state diagram n Design q Class diagrams from a software perspective q Sequence diagrams for common scenarios q Package diagrams to show the large-scale organization of the software q State diagrams for classes with complex life histories q Deployment diagrams to show the physical layout of the software 10 6-8pm Wednesday July 28, 2004 COMP5028 Object -Oriented Analysis and Design 2004 Ying ZHOU, School of IT, University of Sydney 28 Fitting UML into a process n Documentation q Not necessary to produce detailed diagrams of the whole system q Use diagrams as sketches that highlight the most important part of the system n Understanding legacy code q Using tools to generate detailed diagrams for key part s of a system