17
UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 2 Lecture 2 Introduction/Overview Introduction/Overview Fri. 9/8/00 Fri. 9/8/00

UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Embed Size (px)

DESCRIPTION

UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000. Lecture 2 Introduction/Overview Fri. 9/8/00. Web Page. Web Page. http://www.cs.uml.edu/~kdaniels/courses/java2000.html. Textbooks. Required: - PowerPoint PPT Presentation

Citation preview

Page 1: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

UMass Lowell Computer Science 91.460

Java and Distributed Computing

Prof. Karen Daniels Fall, 2000

UMass Lowell Computer Science 91.460

Java and Distributed Computing

Prof. Karen Daniels Fall, 2000

Lecture 2Lecture 2

Introduction/OverviewIntroduction/OverviewFri. 9/8/00Fri. 9/8/00

Page 2: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Web PageWeb Page

http://www.cs.uml.edu/~kdaniels/courses/java2000.html

Web PageWeb Page

Page 3: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

TextbooksTextbooks

Required: Java: How to Program, Third Edition by Deitel and Deitel,

Prentice-Hall, 1999. Core Jini by W. Keith Edwards, Prentice-Hall PTR, 1999.

Optional: Java 2 Certification by Jamie Jaworski, New Riders

Publishing, 1999.

Available in UML bookstore

Page 4: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

HomeworkHomework

11 Wed, 9/6 Wed, 9/6 Fri, 9/8 Fri, 9/8 Read Ch 1 (Deitel)Read Ch 1 (Deitel)

HW#HW# AssignedAssigned DueDue ContentContent

Page 5: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Syllabus for Part 1 of the CourseSyllabus for Part 1 of the Course

Lecture Date Topic ReadingWed 9/6,Fri 9/8

Introduction/Overview Deitel: Chapter 1

Mon 9/11 Jini Overview Edwards: Chapters 1, 2Java Fundamentals Deitel

Wed 9/13 Java Overview/C++ Comparison Chapters 2, 3Fri 9/15 Java Applets & Applications Chapters 2, 3

Mon 9/18,Wed 9/20

Data types, Operators, Expressions From chapter:- 4: 4.11, 4.12, 4.13- 5: 5.9Chapters 7, 10

Fri 9/22 Control Structures Rest of chapters 4, 5Mon 9/25 Exception Handling Chapter 14Wed 9/27 Methods, Object-Based Programming Chapters 6, 8Fri 9/29,Mon 10/2

Object-Oriented Programming Chapter 9

Wed 10/4 Files & Streams Chapter 17Fri 10/6 Exam 1 Closed book; Worth 15% of gradeClosed book; Worth 15% of grade

Page 6: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

What is Java?What is Java?

Language developed by Sun MicrosystemsLanguage developed by Sun Microsystems Popular use: World Wide WebPopular use: World Wide Web Platform-independentPlatform-independent Interpreter: Java Virtual MachineInterpreter: Java Virtual Machine Mobile code (Applets): transient, seamlessMobile code (Applets): transient, seamless Fully Object-OrientedFully Object-Oriented Many C++ constructsMany C++ constructs Class library supportClass library support

Page 7: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

A Typical Java EnvironmentA Typical Java Environment

Phase 1Phase 1 EditorEditor DiskDiskProgram is created in editor Program is created in editor and stored on disk.and stored on disk.

Phase 2Phase 2CompilerCompiler DiskDisk

Compiler creates bytecodes Compiler creates bytecodes and stores them on disk.and stores them on disk.

Phase 3Phase 3

DiskDisk

Class LoaderClass Loader......

Primary Primary MemoryMemory

Class loader puts Class loader puts bytecodes in memory.bytecodes in memory.

Phase 4Phase 4 Bytecode VerifierBytecode Verifier ......

Primary Primary MemoryMemory

Bytecode verifier confirms all Bytecode verifier confirms all bytecodes are valid & abide bytecodes are valid & abide by security constraints.by security constraints.

Phase 5Phase 5 InterpreterInterpreter ......

Primary Primary MemoryMemory

Interpreter (JVM) executes Interpreter (JVM) executes bytecodes by reading & bytecodes by reading & translating into machine translating into machine language.language.[Deitel 99][Deitel 99]

Page 8: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

What is Distributed Computing?What is Distributed Computing?

Distributed system: Distributed system: collection of computing collection of computing devices that communicate with each otherdevices that communicate with each other

Challenges:Challenges: heterogeneous hardware, softwareheterogeneous hardware, software asynchronyasynchrony limited local knowledgelimited local knowledge failuresfailures

[Attiya, Welch 99][Attiya, Welch 99]

Page 9: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Eight Fallacies of Distributed ComputingEight Fallacies of Distributed Computing

The network is reliableThe network is reliable Latency is zeroLatency is zero Bandwidth is infiniteBandwidth is infinite The network is secureThe network is secure

“Essentially everyone, when they first build a distributed application, makes the following eight

assumptions. All prove to be false in the long run, and all can cause big trouble and painful learning

experiences.” - Peter Deutsch

Topology doesn’t changeTopology doesn’t change There is one administratorThere is one administrator Transport cost is zeroTransport cost is zero The network is homogeneousThe network is homogeneous

Page 10: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Why Java & Distributed Computing?Why Java & Distributed Computing?

Platform independence helps with heterogeneous Platform independence helps with heterogeneous hardware, software challengehardware, software challenge

Built-in support for:Built-in support for: Multithreading: concurrent multiple activitiesMultithreading: concurrent multiple activities Client-Server computing: servlets, JDBCClient-Server computing: servlets, JDBC Remote Method Invocation (RMI): method calls across Remote Method Invocation (RMI): method calls across

networknetwork Networking: socket-based communication views Networking: socket-based communication views

networking like file I/Onetworking like file I/O

Page 11: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Our Distributed Computing Goal:Managing A Complex Enterprise

Our Distributed Computing Goal:Managing A Complex Enterprise

TelecommunicationsTelecommunications

Page 12: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Enterprise CharacteristicsEnterprise Characteristics

Many participantsMany participants hardware, softwarehardware, software varied communicationvaried communication

Highly distributedHighly distributed Frequent changesFrequent changes

mobile clientsmobile clients service availabilityservice availability

Page 13: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

What is Jini?What is Jini?

Java-based connection framework Java-based connection framework developed by Sun Microsystemsdeveloped by Sun Microsystems

Philosophy:Philosophy: plug ‘n play networkplug ‘n play network blur distinction between hardware and softwareblur distinction between hardware and software ““self-healing”self-healing”

Elements: discovery, lookup, leasing, Elements: discovery, lookup, leasing, remote events, transactions, JavaSpacesremote events, transactions, JavaSpaces

Page 14: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Background on Jini Technology Background on Jini Technology

proxy manages service interaction

Client

Lookup Service

Service Item

Proxy

AttributeAttributeAttributeAttribute

Service Provider

Service Item

Proxy

AttributeAttributeAttributeAttribute

Service Item

Proxy

AttributeAttributeAttributeAttribute

Assumes Java and network Consists of Java classes

Works at application level

Page 15: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

HomeworkHomework

11 Wed, 9/6 Fri, 9/8 Wed, 9/6 Fri, 9/8 Read Ch 1 (Deitel) Read Ch 1 (Deitel)

22 Fri, 9/8 Fri, 9/8 Mon, 9/11 Read Ch 1, 2 (Edwards) Mon, 9/11 Read Ch 1, 2 (Edwards)

Fri, 9/15Fri, 9/15 Read Ch 2, 3 (Deitel) Read Ch 2, 3 (Deitel)

Fri, 9/15 Fri, 9/15 Assignment #1, Part 1 Assignment #1, Part 1

short-answer questionsshort-answer questions

Mon, 9/18 Assignment #1, Part 2Mon, 9/18 Assignment #1, Part 2 “Hello World” programming“Hello World” programming

(application and applet)(application and applet)

HW#HW# AssignedAssigned DueDue ContentContent

Homework is due at the start of lecture on the due date.Homework is due at the start of lecture on the due date.

Page 16: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

Computing EnvironmentComputing Environment

Java 2 platform: Java 2 SDK v. 1.2.1Java 2 platform: Java 2 SDK v. 1.2.1 http://www.javasoft.com/products/jdk/1.2http://www.javasoft.com/products/jdk/1.2

Jini v. 1.1Jini v. 1.1 http://www.javasoft.com/products/jinihttp://www.javasoft.com/products/jini

UML CS UNIX environmentUML CS UNIX environment Optional: Optional:

PC environment (code must also run on UNIX)PC environment (code must also run on UNIX) Java integrated development environmentJava integrated development environment

2 are on disk with Deitel textbook (NetBeans caveat)2 are on disk with Deitel textbook (NetBeans caveat)

Make sure you have a UML CS UNIX accountMake sure you have a UML CS UNIX account

Page 17: UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000

C++ DiagnosticC++ Diagnostic

Assess C++ background Will not contribute to the course grade Answers on the way out of class Name is optional Provide code snippets, not entire programs Leave unknowns blank