meeting -*- Outline -*- needed: course text books tell them to read: chapters 1-2 of Arnold, Gosling, Holmes and possibly others mentioned in the course syllabus for Java and OO background * The course vision ** Meta Explain that when starting a project, you go through an inception phase, where you lay out the idea, the motivation, and discuss stakeholder problems and goals. We're going to do that now for this course; you are the clients, I'm implementing... ** Vision introduction The main idea is for you to design programs in a way that allows evolution; that is, that both embraces and controls change. ** Business Motivation Software maintenance consumes a large fraction of cost and effort. People aren't good at making detailed requirements and design right. But top-down design requires getting these right, since change requires you to start over. Information hiding and polymorphism (subtyping) help here... ** What is object-orientation? *** meta A key problem is getting a common vocabulary/understanding with the clients, this is analysis. *** Object-based Get 2 volunteers give the first two pieces of paper, write the word "data" on one, and the word "structure" on the second rip the pieces of paper out of their hands, and concatenate the words and first characters give second two pieces of paper, ask them to write the word "object" on one, and the word "based" on the second ask them to tell you the concatenation of these words ask them to tell you the concatenation of the first letters of each word *** Object-oriented Get a third volunteer, give them 3 pieces of paper, have them write "object" "oriented" and "design" on them ask them to tell you the concatenation of the first two words ask them to tell you the concatenation of the first letters of each of the first two words Explain this demonstrates the difference between procedural, data structure programming, and object-oriented design and programming Q: In which paradigm were my assistants most helpful? Explain the idea of protocols and subtyping with the third volunteer Q: How is the word "object" in normal English usage different from what we mean by "object"? it's more like a dumb data structure, we want objects to be smart, helpful Q: what about "objectify"? Summarize all of this on the board ** What is analysis and design? see Larman's chapter 1 ------------------------------------------ ANALYSIS def: *analysis* is investigation of a problem def: *requirements analysis* is investigation of what a system should do. I.e., what is the right system to build? Requirements can be codified in use cases. Example use case: Run a compiler: The user gives source files, the compiler produces object files and error messages. ------------------------------------------ There's nothing OO about this, which isn't bad. Note that we don't talk about "displaying" things (UI free). So we can distinguish ... ------------------------------------------ OBJECT-ORIENTED (OO) ANALYSIS Describes the domain in terms of objects. Identifies noteworthy: - concepts, - attributes, - associations What concepts are there in the domain of running a compiler? What attributes? What associations? ------------------------------------------ ... |--------------| | Error Report | |--------------| | line | | column | | trouble | |--------------| | * | | Found In | | 1 |----------| |-------------| | User | 1 Gives * | Source File | |----------|-----------|-------------| | | | name | |----------| |-------------| | | * | 1 | 1 ------------- | | | Compiles |> | | Runs | | | | | | 1 | 1 | 1 |------------| Produces |-------------| | Compiler |------------| Object File | |------------| 1 * |-------------| | | | | |------------| |-------------| The above are supposed to describe "real-world" concepts, not software artifacts E.g., in Larman's dice game, the dice, the user, the game ------------------------------------------ ARCHITECTURE We will generally build systems in 3 layers: User Interface ======================= Application Logic ======================= Services ------------------------------------------ Q: What advantages might this have? reuse, ease of understanding, cohesion... ------------------------------------------ DESIGN def: A *design* is a conceptual solution (a plan of how to solve the problem) An OO design defines classes of software objects and how they collaborate to fulfill the requirements. What classes might we have for running a compiler? What attributes? Associations? Responsibilities? ------------------------------------------ Examples: Partial Class diagram for compiler |-------------| |-------------| | Compilation | | Source File | |-------------| 1 * |-------------| | |------------| file: File | |-------------| Compiles |-------------| | compile() | | getLine() | |-------------| |-------------| | 1 | Uses v 1 |----------------| | Options | |----------------| | warnLevel: int | | | |----------------| | setWarnLevel() | |----------------| These describe classes in the software, not the real world don't explain all the notation, that's not the point, the point is the distinction between analysis and design ** Overview *** meta this is like a feature list *** overview of course ------------------------------------------ THE COURSE IN A NUTSHELL We learn OO techniques for iterative analysis and design (and development) by analyzing and designing a system in several passes. Main skills: - requirements analysis - responsibility assignment Supporting skills/knowledge: - OO programming (in Java) - UML notation How? - some individual work to get concepts, and notation clear - team projects, 3-4 people per team - several iterations of same project The class meeting: - 3 "lectures" per week - try to make them interactive via exercises, some quizzes - some devoted to team meeting or review or help (no separate discussion sect.) ------------------------------------------ ** objectives *** meta These are the stakeholder goals To be finalized with student input. *** main objectives In one sentence, the main objective is that you will be able to create and justify object-oriented designs that accomplish their goals and that are robust and evolvable. ------------------------------------------ Com S 362 ESSENTIAL OBJECTIVES You should be able to: 1. Analyze system requirements and model problem domains. 2. Evaluate the quality of an analysis, and be able to explain how to improve it. 3. Design and build object-oriented systems. 4. Explain and justify designs based on design principles, patterns, and heuristics. 5. Evaluate the quality of a design, and be able to explain how to improve it. 6. Write object-oriented code to correctly implement a design. Reading and writing - Java - UML are a necessary skills ------------------------------------------ Why these objectives? - analysis, design, and construction are essential skills in all computing work - knowing reasons for good designs helps make good designs more quickly - need to be able to criticize and improve designs, because that's how we can improve our work and those of others - writing code is necessary feedback - Java makes UI construction easy, people are more productive than in C++ (also allows us to use JML) - UML is pretty standard nowadays reasons and motivations for OO will be presented next time ** syllabus *** meta The syllabus is a design or at least a phase plan, and the rest is pretty much like other requirements and constraints To be finalized with student input *** actual syllabus see the web, has readings and ties to the "meeting outlines" is only a rough plan, we will revise as we go (iterative development) Q: How much are you willing to read? we can go faster if you read more but the time of the final exam period is there, and is final *** prerequisites We intend to enforce the formal prerequisites as best we can, if you don't have these, drop this course. ------------------------------------------ PREREQUISITES C- or better in Com S 228 ------------------------------------------ Q: What did you learn about ADTs in 228? Q: What did you learn about information hiding in 228? Q: Why is information hiding important? Q: Did you learn about and use inheritance in 228? *** texts show them ------------------------------------------ TEXTBOOKS Required: 1. Craig Larman. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition. Prentice Hall PTR, Upper Saddle River, NJ, 2001. ISBN 0130925691. 2. Ken Arnold, James Gosling, and David Holmes. The Java Programming Language Third Edition. Addison-Wesley, Reading, Mass., 2000. ISBN 0201704331. Recommended: Martin Fowler with Kendall Scott. UML Distilled Third Edition: A Brief Guide to the Standard Object Modeling Language. Addison-Wesley Longman, Inc., Reading, MA, 2003. ISBN 0321193687. Alan Shalloway and James R. Trott. Design Patterns Explained: A New Perspective on Object-Oriented Design. Addison-Wesley, Boston, MA, 2002. ISBN 0-201-71594-5. ------------------------------------------ These are also on reserve Definitely buy the required ones, others won't be an absolute necessity to own, you can read on reserve. You may want to share copies in a team. *** grading ------------------------------------------ GRADING + No curve grading + Your grade is 40% based on exams 50% on homework 10% on exercises and quizzes ------------------------------------------ details in grade_policy web page (part of the handouts) We can discuss this also *** ask for questions/concerns discuss them