Top Banner
Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a Computer? 1.3 Computer Organization 1.4 Evolution of Operating Systems 1.5 Personal, Distributed and Client/Server Computing 1.6 Machine Languages, Assembly Languages and High-Level Languages 1.7 History of C++ 1.8 History of Java 1.9 Java Class Libraries 1.10 FORTRAN, COBOL, Pascal and Ada 1.11 BASIC, Visual Basic, Visual C++, C# and .NET 1.12 The Internet and the World Wide Web 1.13 Basics of a Typical Java Environment
26
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: jhtp5_01

Chapter 1 – Introduction to Computers, the Internet, and the Web

Outline1.1 Introduction1.2 What Is a Computer?1.3 Computer Organization1.4 Evolution of Operating Systems1.5 Personal, Distributed and Client/Server Computing1.6 Machine Languages, Assembly Languages and High-Level Languages1.7 History of C++1.8 History of Java1.9 Java Class Libraries1.10 FORTRAN, COBOL, Pascal and Ada 1.11 BASIC, Visual Basic, Visual C++, C# and .NET 1.12 The Internet and the World Wide Web1.13 Basics of a Typical Java Environment

Page 2: jhtp5_01

Chapter 1 – Introduction to Computers, the Internet, and the Web

1.14 General Notes about Java and This Book1.15 Thinking About Objects: Introduction to Object Technology and the Unified Modeling Language1.16 Discovering Design Patterns: Introduction

Page 3: jhtp5_01

1.1 Introduction

• Java How to Program, Fifth Editiono Java 2 Standard Editiono Object-oriented programming

Page 4: jhtp5_01

1.2 What Is a Computer?

• Computero Performs computations and makes logical decisionso Millions / billions times faster than human beings

• Computer programso Sets of instructions for which computer processes data

• Hardwareo Physical devices of computer system

• Softwareo Programs that run on computers

Page 5: jhtp5_01

1.3 Computer Organization

• Six logical units of computer systemo Input unit

Mouse, keyboardo Output unit

Printer, monitor, audio speakerso Memory unit

Retains input and processed informationo Arithmetic and logic unit (ALU)

Performs calculationso Central processing unit (CPU)

Supervises operation of other deviceso Secondary storage unit

Hard drives, floppy drives

Page 6: jhtp5_01

1.4 Evolution of Operating Systems

• Batch processingo One job (task) at a timeo Operating systems developed

Programs to make computers more convenient to use Switch jobs easier

• Multiprogrammingo “Simultaneous” jobso Timesharing operating systems

Page 7: jhtp5_01

1.5 Personal, Distributed and Client/Server Computing

• Personal computingo Computers for personal use

• Distributed computingo Computing performed among several computers

• Client/server computingo Servers offer common store of programs and datao Clients access programs and data from server

Page 8: jhtp5_01

1.6 Machine Languages, Assembly Languages and High-Level Languages

• Machine languageo “Natural language” of computer componento Machine dependent

• Assembly languageo English-like abbreviations represent computer operationso Translator programs convert to machine language

• High-level languageo Allows for writing more “English-like” instructions

Contains commonly used mathematical operationso Compiler convert to machine language

• Interpretero Execute high-level language programs without compilation

Page 9: jhtp5_01

1.7 History of C++

• C++o Evolved from C

Evolved from BCPL and Bo Provides object-oriented programming capabilities

• Objectso Reusable software components that model real-world items

Page 10: jhtp5_01

1.8 History of Java

• Javao Originally for intelligent consumer-electronic deviceso Then used for creating Web pages with dynamic contento Now also used for:

Develop large-scale enterprise applications Enhance WWW server functionality Provide applications for consumer devices (cell phones, etc.)

Page 11: jhtp5_01

1.9 Java Class Libraries

• Classeso Include methods that perform tasks

Return information after task completiono Used to build Java programs

• Java contains class librarieso Known as Java APIs (Application Programming Interfaces)

Page 12: jhtp5_01

1.10 FORTRAN, COBOL, Pascal and Ada

• Fortrano FORmula TRANslator

• COBOLo COmmon Business Oriented Language

• Pascalo Structured programming

• Adao Multitasking

Page 13: jhtp5_01

1.11 BASIC, Visual Basic, Visual C++, C# and .NET

• BASICo Beginner’s All-Purpose Symbolic Instruction Code

• Visual Basic .NETo Framework Class Library (FLC)

• Visual C++o Microsoft Foundation Classes (MFC)

• C#o C-Sharp

• .NETo .NET platform

Page 14: jhtp5_01

1.12 The Internet and the World Wide Web

• Interneto Developed more than four decades ago with DOD fundingo Originally for connecting few main computer systemso Now accessible by hundreds of millions of computers

• World Wide Web (WWW)o Allows for locating/viewing multimedia-based documents

Page 15: jhtp5_01

1.13 Basics of a Typical Java Environment

• Java programs normally undergo five phaseso Edit

Programmer writes program (and stores program on disk)o Compile

Compiler creates bytecodes from programo Load

Class loader stores bytecodes in memoryo Verify

Verifier ensures bytecodes do not violate security requirementso Execute

Interpreter translates bytecodes into machine language

Page 16: jhtp5_01

Fig. 1.1 Typical Java environment.

PrimaryMemory

.

.

.

.

.

.

Disk

Disk

Disk

Editor

Compiler

Class Loader

Program is created in an editor and stored on disk in a file ending with .java.

Compiler creates bytecodes and stores them on disk in a file ending with .class.

Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory.

Phase 1

Phase 2

Phase 3

PrimaryMemory

.

.

.

.

.

.

Bytecode Verifier Bytecode verifier confirms that all bytecodes are valid and do not violate Java’s security restrictions.

Phase 4

PrimaryMemory

.

.

.

.

.

.

InterpreterInterpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes.

Phase 5

Page 17: jhtp5_01

1.14 General Notes about Java and This Book

• Geared for novice programmers• We stress clarity

Page 18: jhtp5_01

1.15 Thinking About Objects: Introduction to Object Technology and the Unified Modeling

Language• Object orientation• Unified Modeling Language (UML)

o Graphical language that uses common notationo Allows developers to represent object-oriented designs

Page 19: jhtp5_01

1.15 Thinking About Objects (cont.)

• Objectso Reusable software components that model real-world itemso Look all around you

People, animals, plants, cars, etc.o Attributes

Size, shape, color, weight, etc.o Behaviors

Babies cry, crawl, sleep, etc.

Page 20: jhtp5_01

1.15 Thinking About Objects (cont.)

• Object-oriented design (OOD)o Models real-world objectso Models communication among objectso Encapsulates attributes and operations (behaviors)

Information hiding Communication through well-defined interfaces

• Object-oriented languageo Programming in object oriented languages is called object-

oriented programming (OOP)o Java

Page 21: jhtp5_01

1.15 Thinking About Objects (cont.)

• Object-Oriented Analysis and Design (OOA/D)o Essential for large programso Analyze program requirements, then develop solutiono UML

Unified Modeling Language

Page 22: jhtp5_01

1.15 Thinking About Objects (cont.)

• History of the UMLo Need developed for process with which to approach OOA/Do Brainchild of Booch, Rumbaugh and Jacobsono Object Management Group (OMG) supervisedo Version 1.4 is current version

Version 2.0 scheduled tentatively for release in 2003

Page 23: jhtp5_01

1.15 Thinking About Objects (cont.)

• UMLo Graphical representation schemeo Enables developers to model object-oriented systemso Flexible and extendible

Page 24: jhtp5_01

1.16 Discovering Design Patterns: Introduction

• Effective design crucial for large programs • Design patterns

o Proven architectures for developing object-oriented software Architectures created from accumulated industry experience

o Reduce design-process complexityo Promotes design reuse in future systemso Helps identify common design mistakes and pitfallso Helps design independently of implementation languageo Establishes common design “vocabulary”o Shortens design phase in software-development process

Page 25: jhtp5_01

1.16 Discovering Design Patterns (cont.)

• Design patternso Similar to architectural elements

arches and columnso Used by developers to construct sets of classes and objects

• Developerso Familiarity with patterns to understand how to use patterns

Page 26: jhtp5_01

1.16 Discovering Design Patterns (cont.)

• History of Design Patternso Gamma, Helm, Johnson and Vlissides

“Gang of Four” Design Patterns, Elements of Reusable Object-Oriented

Software (Addison Wesley: 1995) Established 23 design patterns

Creational Instantiate objects Structural Organize classes and objects Behavioral Assign responsibilities to objects