1 / 20

“ Perfect Quote ”

“ 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 . Language Design.

ryder
Télécharger la présentation

“ Perfect Quote ”

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. “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. Java Goals

  2. Language Design • 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 Java Goals

  3. 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. Java Goals

  4. 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 Java Goals

  5. 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. Java Goals

  6. Java : Design Goals A general-purpose concurrent object-oriented language for the Internet. Java Goals

  7. Top Ten Design Goals Java Goals

  8. Simplicity • Programmer Perspective • Automatic garbage collection. • “Unconstrained” array type. • Implementer Perspective • Only “single” class inheritance. • Restricted overloading. • E.g.,Pascal > Modula-2 > Modula-3. Java Goals

  9. Portability • Hardware Independence • Java source => “Architecture Neutral” Byte code • Operating System Independence • Java APIs for I/O, networking, GUI, concurrent programming, etc. Java Goals

  10. 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. Java Goals

  11. 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 Java Goals

  12. Java • Class-based language. • Has object types (based on classes). • Subclassing implies subtyping • but there is subtyping independent of subclassing. • Static typing Java Goals

  13. 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. Java Goals

  14. Java : Compiler and Interpreter source code javac byte code java native code mips pentium sparc alpha Java Goals

  15. Java Goals

  16. Interpretation and Security • Java programs arecompiledintobyte codesfor a (hardware-independent)Java Virtual Machine, and is executed by an interpreter. • Just-In-Time compilerconverts byte codes into native codes, for efficiency. • An interpreter forJVMverifies and thenexecutesJavabyte codes. This step incorporates Security Checks. Java Goals

  17. 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 Java Goals

  18. 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) Java Goals

  19. 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). • A 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. Java Goals

  20. (cont) • Java supports network programming. • Java supports mobile computing. • Compiled to compact, platform independent byte codes • Dynamic linking. • KVM Java Goals

More Related