1 / 20

Intermediate Programming — Chapter 1 —

Intermediate Programming — Chapter 1 —. MIS 233 Summer 2010. Introduction to Computers, the Internet, and the Web. Introduction History of Java Java Class Libraries Basics of a Typical Java Environment Thinking About Objects. Introduction. Java How to Program, 8th Edition

Download Presentation

Intermediate Programming — Chapter 1 —

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intermediate Programming — Chapter 1 — MIS 233 Summer 2010

  2. Introduction to Computers, the Internet, and the Web • Introduction • History of Java • Java Class Libraries • Basics of a Typical Java Environment • Thinking About Objects

  3. Introduction • Java How to Program, 8th Edition • Java Standard Edition 6 SE 6.0 • Mustang • Java 2 Enterprise Edition (J2EE) • Java 2 Micro Edition (J2ME) • J2SE Development Kit (JDK)

  4. Introduction • Java How to Program, 8th Edition • Deitel & Deitel • Java Standard Edition 6 SE 6.0 • Mustang • Java 2 Enterprise Edition (J2EE) • Java 2 Micro Edition (J2ME) • J2SE Development Kit (JDK)

  5. Introduction • Structured programming • Object oriended programing

  6. History of Java • Java by Sun Microsystems in 1991 team leader: James Gosling • Originally for intelligent consumer-electronic devices • Then used for creating Web pages with dynamic content • Now also used for: • Develop large-scale enterprise applications • Enhance WWW server functionality • Provide applications for consumer devices (cell phones, etc.)

  7. Java Class Libraries • Classes • Contain methods that perform tasks • Return information after task completion • Used to build Java programs • Java contains class libraries • Known as Java APIs (Application Programming Interfaces)

  8. Basics of a Typical Java Environment • Java systems contain • Environment • Language • APIs • Class libraries

  9. Basics of a Typical Java Environment (cont.) • Java programs normally undergo five phases • Edit • Programmer writes program (and stores program on disk) • Compile • Compiler creates bytecodes from program • Load • Class loader stores bytecodes in memory • Verify • Verifier ensures bytecodes do not violate security requirements • Execute • Interpreter translates bytecodes into machine language

  10. Basics of a Typical Java Environment (cont.) • Edit • extension .java • the file contains java source code • Integrated development environments IDE • writting and editing programs • debuging logic errors • Examples of IDEs: • Eclipse: www.eclipse.org • NetBeans: www.netbeans.org • JBuilder: www.borland.com

  11. Basics of a Typical Java Environment (cont.) • Compile • source code into bytecodes • executed by java virtual machine JVM • part of the JDK • platform independent instructions • not dependent on particular hardware platform • portable • Load • class loader takes the .class files and transfers to mai memory • any class file provided by java into memory as well

  12. Basics of a Typical Java Environment (cont.) • Execute • JVM executes the bytecodes • early versions simply and interpreter • slower as :one bytecode at a time • Just-in-time JIT compliation • combination of interpretation and compilation • Compilation • source to bytecodes (platform independent) • bytecodes to machine language (platform dependent)

  13. Fig. 1.1 A typical Java environment.

  14. Thinking About Objects • Objects • Reusable software components that model real-world items • Look all around you • People, animals, plants, cars, etc. • Attributes • Size, shape, color, weight, etc. • Behaviors • Babies cry, crawl, sleep, etc. • Examples • object:student • attributes: name,ID, status, • behavior: takes a course, send to advisor,...

  15. Thinking About Objects (cont.) • Examples • object:bank account • attributes: deposited amount, account number • behavior: deposit money, withdraw money , transfer money,... • object: employee • attributes:name ,department, salery,... • behavior: make a sale, work in a project, ... employee... • object: a regtangular shape • attributes:hight, with, x –y coordinate, color,... • behavior:area, cicunference,......

  16. Thinking About Objects (cont.) • Object-oriented design (OOD) • Models real-world objects • class: • a blueprint for objcets • inheritence: • new classes of objects are derived absorbing characteristics of existing classes and adding unique characteristics of their own • e.g.: • a manger is a personel • an undergrad student is a student • a saving accout is an bank account

  17. Thinking About Objects (cont.) • communication • Models communication among objects • send messages to each other • e.g.: • a bank account object get the message of decreasing the balance • customer sent the message to withdraw money • encapsulation: • Encapsulates data (attributes) and functions (behaviors) • Information hiding • Communication through well-defined interfaces • e.g.: • using the breke pedal to stop a car without knowing working principles

  18. Thinking About Objects (cont.) • Object-oriented language • Programming is called object-oriented programming (OOP) • Java, C# • unit of programming is class • Procedural programming languages • Programming is action oriented • C:unit of programming is a function • class: • from which objects are instantiated (created) • java classes have • methods: implement opperations • fields: implements attributes

  19. Thinking About Objects (cont.) • class: • classes to objcets • blueprint to houses • many objcets can be instantiated from the same class • e.g.: a student class • ali, ahmet are particular students instantiated from the student class • each has a name, student number • each can take a corse, pay registation fee,

  20. Thinking About Objects (cont.) • Analysis your project requirements • determining what the system is to do • Design the system • how the system shold do it • Object-Oriented Analysis and Design (OOAD) • Essential for large programs • Analyze program requirements, then develop solution • Unified Modeling Language (UML) • Graphical language that uses common notation • Allows developers to represent object-oriented designs

More Related