Create accurate body images for surgery. Share media data - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Create accurate body images for surgery. Share media data

Description:

Create accurate body images for surgery. Share media data. Stay in ... One Trader class, multiple Trader objects (human/auto) 9. OOP Concepts. Encapsulation ... – PowerPoint PPT presentation

Number of Views:75
Avg rating:3.0/5.0
Slides: 13
Provided by: Fernando131
Category:

less

Transcript and Presenter's Notes

Title: Create accurate body images for surgery. Share media data


1
Introduction to Programming with Java
  • Object Oriented Programming
  • Compiling Running Java Programs

2
Computing in the world
  • We live in a complicated world.
  • Computing is how we deal with it
  • Search billions of Web pages
  • Manage air traffic
  • Automate investment trading
  • Computer animation and games
  • Create accurate body images for surgery
  • Share media data
  • Stay in touch with our friends

3
Coping in a computing world
  • Modularity
  • Break big problems into simpler sub-problems
  • Solve big problems by composing the solutions of
    the sub-problems
  • Abstraction
  • Find common features and express solutions in
    terms of those features

4
Software Design Considerations
  • How can I break this complicated
    system/simulation/game in to manageable pieces?
  • How can I make the code reliable (according to
    spec)
  • How can I make the code easy to
  • Test and debug
  • Add more (potentially unforseen) pieces (ideally
    by reusing some of the code weve already
    written)
  • Accomplish inevitable design changes by rewriting
    as few of those pieces as possible
  • Use existing code thats already been debugged

5
Object Oriented Programming
  • A program (written in an OOP language) is a
    collection of cooperating objects
  • An object has
  • state data stored in fields (instance variables)
  • methods named blocks of code that determine how
    an object behaves (also known as
    procedures/functions)
  • A class is a template for creating objects
  • An object is an instance of a class

6
Example Ghost
data
behavior
7
One Ghost ClassMultiple Ghost Objects
8
Methods Questions, Commands
  • Query Methods ask an object about its state
  • // ask a Ghost for its x position
    ghost1.getX()
  • ghost2.getX()
  • Command Methods change an objects state
  • // move a Ghost forward
  • ghost1.move()

9
Program Cooperating Objects
  • 3D Scene
  • One Light class, multiple Light objects
  • One Camera class, multiple Camera objects,
  • Lord of the Rings Simulation
  • One 3D Scene class, one 3D Scene object
  • One Elf class, many Elf objects
  • One Orc class, many Orc objects
  • Financial Software
  • One Trade class, multiple Trade objects
    (buy/sell/etc)
  • One Trader class, multiple Trader objects
    (human/auto)

10
OOP Concepts
  • Encapsulation
  • Data, and the methods that operate on it, are
    grouped in an object.
  • An objects data (state) can/should be
    protected by making it read/writeable only via
    its methods (information hiding)
  • Inheritance
  • Write code once in class A and reuse it many
    times in subclasses B, C, and D. We call A a
    superclass/supertype and B, C, D
    subclasses/subtypes.
  • Polymorphism
  • Code can take on many forms. This is
    accomplished via supertype-subtype relationships
    established via inheritance and interfaces. (Also
    with generics in Java 1.5.)
  • Abstraction
  • We can write code that ignores the details.

11
Programming Languages
  • Unlike human languages
  • Designed for instructing computers to solve
    problems
  • The listener (the compiler) is exacting
    unforgiving (grr!)
  • Like human languages
  • they have a grammar that has evolved
  • A Sketch of Javas Evolution
  • Machine language (code of 1s and 0s)
  • Assembly language (e.g. add, sub, jmp)
  • C (more English-like, procedural, pointers)
  • C (loosely object oriented with multiple
    inheritance)
  • Java / C (purely object oriented with single
    inheritance, strongly typed, garbage collection,
    no pointers)
  • Evolutionary trend more modularity and
    abstraction

12
Java Compiler andVirtual Machine
  • The Java Compiler
  • Checks syntax / grammar
  • Creates a .class file which contains byte code
    (virtual machine code)
  • Java Byte Code
  • Is portable
  • The JVM
  • Translates byte code in to instructions for a
    particular processor, which runs the program
Write a Comment
User Comments (0)
About PowerShow.com