Download presentation
Presentation is loading. Please wait.
Published byDaisy Rodgers Modified over 9 years ago
1
CS884 (Prasad)Java Goals1 “Perfect Quote” You know you've achieved perfection in design, Not when you have nothing more to add, But when you have nothing more to take away. - Antoine de Saint Exupery.
2
CS884 (Prasad)Java Goals2 One thing the language designer should not do is to include untried ideas of ones own. The task is one of consolidation, not innovation. - C. A. R. Hoare In language design, the central problem is to organize a variety of concepts in a way which exhibits uniformity and generality. - J. C. Reynolds Language Design
3
CS884 (Prasad)Java Goals3 Conflicting goals lead to difficult trade-offs. –Safety checks “burden” the compiler and/or the run-time. –Safety and machine independence may exclude efficient low-level operations. –Type systems restrict programming style in exchange for strong guarantees.
4
CS884 (Prasad)Java Goals4 A language addition should whenever possible solve new problems beyond its original purpose --- not create new problems through its interaction with other mechanisms. A prudent language designer, having toyed with a possible new facility, and encountering incompatibilities with more important properties of the design, quickly retreats. -- Bertrand Meyer
5
CS884 (Prasad)Java Goals5 Language Specification Programs –(dynamic) Software Machinery –(static) Naming Environments What entities can be named? How are the names organized into groups? How are the names made known where ever they are needed? Conventions are no substitute for enforced constraints.
6
CS884 (Prasad)Java Goals6 Java : Design Goals A general-purpose concurrent object-oriented language for the Internet.
7
CS884 (Prasad)Java Goals7 Top Ten Design Goals
8
CS884 (Prasad)Java Goals8 Simplicity Programmer Perspective –Automatic garbage collection. –“Unconstrained” array type. Implementer Perspective –Only “single” class inheritance. –Restricted overloading. E.g., Pascal > Modula-2 > Modula-3.
9
CS884 (Prasad)Java Goals9 Portability –Hardware Independence Java source => “Architecture Neutral” Byte code –Operating System Independence Java APIs for I/O, networking, GUI, concurrent programming, etc.
10
CS884 (Prasad)Java Goals10 Portability Architecture-neutral. –Size of integer, char, etc and meaning of floating point operations fixed by the language (not by an implementation). All “behavioral” aspects of a Java program defined by the Java language spec. –Order of evaluation of operands fixed. –Error and Exception handling.
11
CS884 (Prasad)Java Goals11 Object-Oriented Programming Programming with abstract data types –Data Abstraction Separation of Spec. and Impl. –Modularity Logically related entities are textually close. –Encapsulation Controlling visibility of names. Code and Interface Reuse –Inheritance ; Dynamic binding
12
CS884 (Prasad)Java Goals12 Java Class-based language. Has object types (based on classes). Subclassing implies subtyping –but there is subtyping independent of subclassing. Static typing
13
CS884 (Prasad)Java Goals13 Reliability and Robustness Strong Typing –every variable and every expression has a type known at compile-time. –type limits the values a variable can hold and the values an expression can produce at run- time. Exceptions –signaling violation of semantic constraints.
14
CS884 (Prasad)Java Goals14 Java : Compiler and Interpreter javac java source code byte code native code mipspentiumsparcalpha
15
CS884 (Prasad)Java Goals15
16
CS884 (Prasad)Java Goals16 Interpretation and Security Java programs are compiled into byte codes for a (hardware-independent) Java Virtual Machine, and is executed by an interpreter. Just-In-Time compiler converts byte codes into native codes, for efficiency. An interpreter for JVM verifies and then executes Java byte codes. This step incorporates Security Checks.
17
CS884 (Prasad)Java Goals17 Evolution of Sun’s JDK Java 1.0: Interpreter Java 1.1: Interpreter + JIT Compiler Java 2 : Hotspot Profiling and Adaptive Dynamic Compilation of “hot” code Method in-lining and other aggressive optimizations, and Decompilation Improved Memory Management for long-running (server) programs Fast Thread Synchronization
18
CS884 (Prasad)Java Goals18 Concurrent Programming Threads can share address space. In Java, threads are modeled after Hoare’s monitors. Java is a multi-threaded system, which is very convenient for coding interactive or multi-media applications. – Doing I/O concurrently with reading a document. (downloading via browser) – Periodic updating of the screen with data acquired in real-time. (sports/stocks ticker)
19
CS884 (Prasad)Java Goals19 Distributed Processing HTML and WWW contributed immensely to the sharing of (distributed) static data. CGI scripts enabled customization of responses based on user input ( client-server ). client-serverA Java applet can further react to user input and change behavior dynamically. It can provide an alternative to client-server model in that it runs on the client machine.
20
CS884 (Prasad)Java Goals20 (cont) Java supports network programming. Java supports mobile computing. –Compiled to compact, platform independent byte codes –Dynamic linking. –KVM
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.