170 likes | 272 Views
Chapter 1. Sec 58 – Object Oriented Programming and Design. Chapter Objectives. Define programs, programming, and applications Read, explain, and create a class diagram Read, explain, and create an event diagram Explain object-oriented programming (OOP) and object-oriented design (OOD).
E N D
Chapter 1 Sec 58 – Object Oriented Programming and Design
Chapter Objectives • Define programs, programming, and applications • Read, explain, and create a class diagram • Read, explain, and create an event diagram • Explain object-oriented programming (OOP) and object-oriented design (OOD)
Chapter Objectives • Define the terms objects, attributes, methods, and events • Define and explain encapsulation, inheritance, and polymorphism
Object-Oriented Programming and Design • Object-oriented programming • Data and the code that operates on the data are packaged into a single unit called an object • Object-oriented design • Identifies how objects interact with each other to solve a problem
Object-Speak • Aggregation • The concept of an object composed of another object • Generalization hierarchy • A tool displaying a hierarchy of classes, including superclasses and subclasses • Instance • A specific use of a class
Object-Speak • Operation • Activity that reads or manipulates the data of an object • Message • Activates the code to perform one of the operations • Trigger • Causes the message to be sent • Event • The process of a trigger sending a message that results in an operation
Object-Speak • An event diagram graphically represents relationships among event and operations • Useful for designing event-driven programs • Part of the Unified Modeling Language (UML) • The UML provides a standardized model to describe object-oriented designs graphically • The UML is a system of symbols to represent object behavior and program behavior
Encapsulation • The process of hiding the implementation details of an object from its user • The user is shielded from the system’s complexity • An action is transparent if it takes place without any visible effect other than the desired output • Information hiding provides access to an object only through its messages • Objects can be modified without requiring application modification
Inheritance • An efficient way to reuse code by defining a subclass as an extension of another class • The subclass inherits all the data and functions of the superclass • The subclass has at least one attribute or method that differs from its superclass
Polymorphism • Allows an instruction to be given to an object using a generalized command • The same command will obtain different results depending on the object receiving the command • The specific actions internal to the object are encapsulated from the user
What Is the Java SDK? • The Java Software Development Kit (SDK) is a programming package to develop Java applications • The Java Runtime Environment (JRE) provides the tools to deploy Java applications
Features of the J2SE • The Java Compiler • Converts code into bytecode • The Java Virtual Machine • Contains an interpreter to execute the bytecode • The Java API • The standard set of packages available in Java • The Java Applet Viewer • Mini browser to display Java applets
Other Java Development Tools • VATE (value-added text editor) • Color codes elements and numbers lines • Examples: TextPad, JCreator, JGrasp • IDE (integrated development environment) • Builder tool to aid coding and debugging • Examples: Sun ONE Studio, JBuilder, Visual Age, Simplicity • Web server • Deploys servlets • Example: Tomcat
Summary • Alice has prepared you for Object Oriented Programming • Objects • Classes • Instances • Events • Triggers • Those concepts are used in all object oriented programming
Rest of Today • Download the Java Chapter 1 Worksheet from the homework section. • All the answers are in the PowerPoint files from for Chapter 1 (sections 56-58) • Use a piece of paper for your answers – if you need a piece see me…