OOP Primer - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

OOP Primer

Description:

Objects can inherit method names from other objects ... Color. Height. Dragon. Method. Attribute. Object. Match the core idea to the example ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 17
Provided by: bobrey
Category:
Tags: oop | color | names | primer

less

Transcript and Presenter's Notes

Title: OOP Primer


1
OOP Primer
  • Bus 92Fall 2007
  • Notes on Wang, 2006

2
Learning to Program involves
  • How to solve a particular problem
  • How to use a particular programming language
  • How to use a specific program to help you write
    programs in your chosen programming language
  • Editor to write, edit and save your program
  • Compiler to translate the program from a
    high-level programming language (Basic) to a
    lower level computing language (machine code)
  • VB Express is an integrated development
    environment (IDE) that includes both an editor
    and compiler

3
The Hierarchy of Programming Languages
Visual Basic
C
LISP
Compile
Assembly
Machine Code 1110 0110 1111
4
Programming Language Components
Statements
To form
Programs
Combine according to
Syntax
Building Blocks
Functions
Keywords
Functions
Keywords
Keywords
5
Example
MsgBox
Dim Counter as IntegerCounter 1 Do While
Counter lt10 MsgBox (Counter) Counter
Counter 1 Loop
Syntax
Dim
Do
Integer
While
Loop
6
Every VB Program is composed of
  • A User interface
  • Get data -- keyboard, mouse
  • Display information -- printer, screen
  • Instructions that make your program do something
    useful
  • Manipulate and respond to data -- add two
    numbers, select data from a table

7
oop
  • A programming model that facilitates division of
    a program into smaller parts according to 3 core
    ideas
  • Encapsulation
  • Inheritance
  • Polymorphism

8
Encapsulation
  • Objects store both data and the methods that
    manipulate the data in a single location
  • Protects data from being changed by other parts
    of the program

9
Inheritance
  • Code reuse by copying makes it hard to trace
    location of copied code and apply edits
  • With inheritance, object b uses the code stored
    in object a without copying the code
  • Code fixes/updates in object a automatically
    fix/update code in object b

10
Polymorphism
  • Objects can inherit method names from other
    objects
  • Inherited methods can operate according to new
    code that results in different behaviors vs
    method from source object

11
Class/Object/oop example
Class Game Characters
12
Match the core idea to the example
The Dragon object inherits the die method from
the prince object
The Dragon objects move method specifies slow
progressthrough the screen while the Prince
objects move methodspecifies quick leaps across
the screen
Changes to the Dragons move method do notaffect
the Prince objects move method
13
Software Development Lifecycle (SDLC)
Project Planning, Feasibility Analysis
Systems Analysis
Systems Design
Implementation
Integration Testing
Acceptance Implementation Deployment
Maintenance
Bus 92 (overview)
Bus 110B
Bus 119A (mastery)
14
Casual Use Cases
  • Describe how the application will be used by a
    user to achieve a specific goal
  • Identify the goal of the system
  • List the key steps to achieve the goal
  • Amazon.com example

15
In Class Activity
  • Describe your application to your partner(s)
  • Ask questions if the description is unclear
  • Be ready to describe your partners application
    to the class
  • Build an initial use case for your application to
    share in class

16
HW2
  • Write a use case of the main user interaction
    with the application that you plan to build for
    the class. Send the use case via email (not an
    attachment) to 92thurs07_at_sbcglobal.net by noon on
    Thursday, Sept 6, 2007
  • Read Wang Chapters 1-6. Try to do the exercises
    at home if you can install VB Express on your
    machine
  • Bring your flash drive to class labeled with your
    first name, last name, student ID
Write a Comment
User Comments (0)
About PowerShow.com