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

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Compiler wikipedia , lookup

Abstraction (computer science) wikipedia , lookup

Design Patterns wikipedia , lookup

ILLIAC IV wikipedia , lookup

Java performance wikipedia , lookup

Reserved word wikipedia , lookup

Object-oriented programming wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Transcript
Chapter 1 – Introduction to Computers, the Internet,
and the Web
Outline
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
Introduction
What Is a Computer?
Computer Organization
Evolution of Operating Systems
Personal, Distributed and Client/Server Computing
Machine Languages, Assembly Languages and High-Level
Languages
History of C++
History of Java
Java Class Libraries
FORTRAN, COBOL, Pascal and Ada
BASIC, Visual Basic, Visual C++, C# and .NET
The Internet and the World Wide Web
Basics of a Typical Java Environment
 2003 Prentice Hall, Inc. All rights reserved.
1
Chapter 1 – Introduction to Computers, the Internet,
and the Web
1.14
General Notes about Java
1.15
Thinking About Objects: Introduction to Object Technology
and the Unified Modeling Language
Discovering Design Patterns: Introduction
1.16
 2003 Prentice Hall, Inc. All rights reserved.
2
3
1.1 Introduction
• Java How to Program, Sixth Edition
– Java 2 Standard Edition
– Object-oriented programming
 2003 Prentice Hall, Inc. All rights reserved.
4
1.2
What Is a Computer?
• Komputer:
– Peranti/peralatan yang mampu melaksanakan perhitungan
(komputasi) dan membuat keputusan logika
• Program Komputer (Computer Program):
– Sekumpulan instruksi yang mengontrol pemrosesan data yang
dilakukan komputer.
• Hardware:
– Sekumpulan peralatan yang membentuk komputer.
– Misal: keyboard, mouse, CPU, monitor, CD-ROM, Hard Disk,
Floppy Disk, DVD-ROM, RAM, printer, scanner dsb.
• Software:
– Program yang berjalan di atas komputer.
 2003 Prentice Hall, Inc. All rights reserved.
5
1.3
•
1.
Computer Organization (1)
Secara logis komputer dibagi menjadi 6 bagian:
Input Unit
– Bagian Penerimaan – Receiving Section
– Mendapatkan informasi dari peranti masukan seperti:
keyboard, mouse, microphone, scanner, networks, …
 2003 Prentice Hall, Inc. All rights reserved.
6
1.3
2.
Computer Organization (2)
Output Unit
– Bagian Pengiriman – Shipping Section
– Mengambil informasi yang diproses komputer
– Menempatkan informasi pada peranti-peranti
keluaran (output devices), seperti: monitor, printer,
dsb
 2003 Prentice Hall, Inc. All rights reserved.
7
1.3
Computer Organization (3)
3. Memory Unit
– Akses yang cepat (rapid access) –
Warehouse Section yang memiliki
kapasitas relatif rendah
– Menyimpan informasi dari input unit –
secara langsung tersedia bagi proses
yang ada
– Menyimpan informasi yang telah
diproses – sampai selesai ditempatkan
pada output unit
– Berupa memory (RAM), primary
memory (cache memory pada processor)
 2003 Prentice Hall, Inc. All rights reserved.
8
1.3
Computer Organization (4)
4. Arithmetic and Logic Unit (ALU)
– Bagian Fabrikasi – Manufacturing Section
– Melaksanakan proses perhitungan aritmatika dan
keputusan logika
5. Central Processing Unit (CPU)
– Bagian Administratif / Administrative Section
– Mengawasi dan mengkoordinasi bagian-bagian lain di
dalam komputer
 2003 Prentice Hall, Inc. All rights reserved.
9
1.3
Computer Organization (5)
6. Secondary Storage Unit
– “Warehouse Section” yang memiliki kapasitas besar,
waktu yang lama.
– Sebagai penyimpan – program atau data yang sedang
tidak aktif
– Peranti penyimpan sekunder – Disks (hard disk, floppy
disk, compact disc dsb
– Lebih lama waktu aksesnya dan lebih mahal harganya
daripada primary memory
 2003 Prentice Hall, Inc. All rights reserved.
10
1.4
Evolution of Operating Systems
• Batch processing
– One job (task) at a time
– Operating systems developed
• Programs to make computers more convenient to use
• Switch jobs easier
• Multiprogramming
– “Simultaneous” jobs
– Timesharing operating systems
 2003 Prentice Hall, Inc. All rights reserved.
1.5
Personal, Distributed and Client/Server
Computing
• Personal computing
– Computers for personal use
• Distributed computing
– Computing performed among several computers
• Client/server computing
– Servers offer common store of programs and data
– Clients access programs and data from server
 2003 Prentice Hall, Inc. All rights reserved.
11
1.6 Machine Languages, Assembly
Languages and High-Level Languages
• Machine language
– “Natural language” of computer component
– Machine dependent
• Assembly language
– English-like abbreviations represent computer operations
– Translator programs convert to machine language
• High-level language
– Allows for writing more “English-like” instructions
• Contains commonly used mathematical operations
– Compiler convert to machine language
• Interpreter
– Execute high-level language programs without compilation
 2003 Prentice Hall, Inc. All rights reserved.
12
13
1.7
History of C++
• C++
– Evolved from C
• Evolved from BCPL and B
– Provides object-oriented programming capabilities
• Objects
– Reusable software components that model real-world items
 2003 Prentice Hall, Inc. All rights reserved.
14
1.8
History of Java
• Java
– 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.)
 2003 Prentice Hall, Inc. All rights reserved.
15
1.9
Java Class Libraries
• Classes
– Include 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)
 2003 Prentice Hall, Inc. All rights reserved.
16
1.10 FORTRAN, COBOL, Pascal and Ada
• Fortran
– FORmula TRANslator
• COBOL
– COmmon Business Oriented Language
• Pascal
– Structured programming
• Ada
– Multitasking
 2003 Prentice Hall, Inc. All rights reserved.
1.11 BASIC, Visual Basic, Visual C++, C#
and .NET
• BASIC
– Beginner’s All-Purpose Symbolic Instruction Code
• Visual Basic .NET
– Framework Class Library (FLC)
• Visual C++
– Microsoft Foundation Classes (MFC)
• C#
– C-Sharp
• .NET
– .NET platform
 2003 Prentice Hall, Inc. All rights reserved.
17
18
1.12 The Internet and the World Wide Web
• Internet
– Developed more than four decades ago with DOD funding
– Originally for connecting few main computer systems
– Now accessible by hundreds of millions of computers
• World Wide Web (WWW)
– Allows for locating/viewing multimedia-based documents
 2003 Prentice Hall, Inc. All rights reserved.
19
1.13 Basics of a Typical Java Environment
• 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
 2003 Prentice Hall, Inc. All rights reserved.
Phase 1
Editor
Disk
Phase 2
Compiler
Disk
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.
Primary
Memory
Phase 3
Class Loader
Disk
Phase 4
Bytecode Verifier
. ..
. .
.
Class loader reads
.class files
containing bytecodes
from disk and puts
those bytecodes in
memory.
Primary
Memory
Bytecode verifier
confirms that all
bytecodes are valid and
do not violate Java’s
security restrictions.
. ..
. .
.
Primary
Memory
Phase 5
Interpreter
. ..
. .
.
Fig. 1.1 Typical Java environment.
 2003 Prentice Hall, Inc. All rights reserved.
Interpreter reads
bytecodes and
translates them into a
language that the
computer can
understand, possibly
storing data values as
the program executes.
20
1.15 Thinking About Objects: Introduction to
Object Technology and the Unified Modeling
Language
• Object orientation
• Unified Modeling Language (UML)
– Graphical language that uses common notation
– Allows developers to represent object-oriented designs
 2003 Prentice Hall, Inc. All rights reserved.
21
22
1.15 Thinking About Objects (cont.)
• 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.
 2003 Prentice Hall, Inc. All rights reserved.
23
1.15 Thinking About Objects (cont.)
• Object-oriented design (OOD)
– Models real-world objects
– Models communication among objects
– Encapsulates attributes and operations (behaviors)
• Information hiding
• Communication through well-defined interfaces
• Object-oriented language
– Programming in object oriented languages is called objectoriented programming (OOP)
– Java
 2003 Prentice Hall, Inc. All rights reserved.
24
1.15 Thinking About Objects (cont.)
• Object-Oriented Analysis and Design (OOA/D)
– Essential for large programs
– Analyze program requirements, then develop solution
– UML
• Unified Modeling Language
 2003 Prentice Hall, Inc. All rights reserved.
25
1.15 Thinking About Objects (cont.)
• History of the UML
–
–
–
–
Need developed for process with which to approach OOA/D
Brainchild of Booch, Rumbaugh and Jacobson
Object Management Group (OMG) supervised
Version 1.4 is current version
• Version 2.0 scheduled tentatively for release in 2003
 2003 Prentice Hall, Inc. All rights reserved.
26
1.15 Thinking About Objects (cont.)
• UML
– Graphical representation scheme
– Enables developers to model object-oriented systems
– Flexible and extendible
 2003 Prentice Hall, Inc. All rights reserved.
1.16 Discovering Design Patterns:
Introduction
• Effective design crucial for large programs
• Design patterns
– Proven architectures for developing object-oriented software
• Architectures created from accumulated industry experience
–
–
–
–
–
–
Reduce design-process complexity
Promotes design reuse in future systems
Helps identify common design mistakes and pitfalls
Helps design independently of implementation language
Establishes common design “vocabulary”
Shortens design phase in software-development process
 2003 Prentice Hall, Inc. All rights reserved.
27
28
1.16 Discovering Design Patterns (cont.)
• Design patterns
– Similar to architectural elements
• arches and columns
– Used by developers to construct sets of classes and objects
• Developers
– Familiarity with patterns to understand how to use patterns
 2003 Prentice Hall, Inc. All rights reserved.
29
1.16 Discovering Design Patterns (cont.)
• History of Design Patterns
– 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
 2003 Prentice Hall, Inc. All rights reserved.