You get a bonus - 1 coin for daily activity. Now you have 1 coin

Java technology

Lecture



Java platform

  Java technology

The Java language originated as part of a project to create advanced software (software) for various household appliances. The project was launched in the C ++ language, but soon a number of problems arose, the best means of dealing with which was to change the tool itself - the programming language. It became obvious that a platform-independent programming language is needed, which allows you to create programs that you would not have to compile separately for each architecture and could be used on different processors under different operating systems. The Java language was required to create interactive products for the Internet. In fact, most of the architectural decisions made when creating Java were dictated by the desire to provide syntax similar to C and C ++. In Java, almost identical conventions are used to declare variables, pass parameters, statements, and control the flow of code execution. Java adds all the good features of C ++.

Three key elements came together in the Java language technology:

- Java provides for widespread use of its applets (applets) - small, reliable, dynamic, platform-independent active network applications that are embedded in Web pages. Java applets can be customized and distributed to consumers as easily as any HTML document.

- Java unleashes the power of object-oriented application development, combining simple and familiar syntax with a robust and easy-to-use development environment. This allows a wide range of programmers to quickly create new programs and new applets.

- Java provides the programmer with a rich set of object classes for a clear abstraction of many system functions used when working with windows, the network, and for I / O. The key feature of these classes is that they provide the creation of platform-independent abstractions for a wide range of system interfaces.

Java programming

Kartuzov A.V.

It is generally dangerous to declare every new programming technology revolutionary. If you hurry to cast your vote for the recognition of technology, like the one that is implemented in the Java language, revolutionary - you can throw rotten eggs or put in the category of windruns, greedy for fashionable news. What, then, makes this or that product revolutionary? It can not only be more compact, faster and cheaper. Such a product should change the whole style of work, radically simplifying the solution of complex problems.

The creation of the Java language in 1995 is indeed one of the most significant steps forward in the development of programming environments over the past 20 years. HTML (Hypertext Markup Language) was necessary for the static placement of pages on the World Wide Web (WWW). The Java language was required for a qualitative leap in creating interactive products for the Internet.

Three key elements combined in the technology of the Java language and made it radically different from everything that exists today.

    • Java provides for widespread use its applets (applets) - small, reliable, dynamic, platform-independent active network applications that are embedded in Web pages. Java applets can be customized and distributed to consumers as easily as any HTML document.

    • Java unleashes the power of object-oriented application development, combining simple and familiar syntax with a robust and easy-to-use development environment. This allows a wide range of programmers to quickly create new programs and new applets.

    • Java provides the programmer with a rich set of object classes for the clear abstraction of many system functions used when working with windows, the network, and for I / O. The key feature of these classes is that they provide the creation of platform-independent abstractions for a wide range of system interfaces.

Let's take a closer look at all these three aspects, but first, the story of creation.

History of creation

The Java language originated as part of a project to create advanced software (software) for various household appliances. The project was launched in the C ++ language, but soon a number of problems arose, the best means of dealing with which was to change the tool itself - the programming language. It became obvious that a platform-independent programming language is needed, which allows you to create programs that you would not have to compile separately for each architecture and could be used on different processors under different operating systems.

The birth of the Java language was preceded by a rather interesting story. In 1990, Sun Microsystems software developer Patrick Naughton realized that he was tired of supporting hundreds of different program interfaces used in the company and informed the executive director of Sun Microsystems and his friend Scott McNealy about his intention to go to work NeXT company. McNealy, in turn, asked Noton to compile a list of reasons for his discontent and put forward such a solution to the problems, as if he were God and could do whatever he wanted.

Naughton, although he did not expect that someone would pay attention to his letter, still outlined his claims, ruthlessly criticizing the shortcomings of Sun Microsystems, in particular, the NeWS software architecture that was being developed. To Nothon's surprise, his letter was successful: it was sent to all leading Sun Microsystems engineers, who were quick to respond and express warm support for their colleague and approval of his views on the situation at Sun Microsystems. The appeal was approved by the company's top management, namely, by Bill Joy , the founder of Sun Microsystems, and James Gosling , the chief of Noton.

On the day when Noton had to leave the company, it was decided to create a team of leading developers so that they would do anything but create something extraordinary. A team of six people began to develop a new object-oriented programming language, which was named Oak (Oak), in honor of the tree that grew under the window of Gosling.

Soon, Sun Microsystems turned Green into First Person. The new company had an interesting concept, but could not find a suitable application for it. After a series of failures, the situation suddenly changed for the company: Mosaic browser was announced - the World Wide Web was born, from which the rapid development of the Internet began. Naughton suggested using Oak in creating Internet applications. So Oak became an independent product, soon the Oak compiler and Oak-browser "WebRunner" were written. In 1995, Sun Microsystems decided to announce a new product, renaming it Java (the only reasonable explanation for the name is the programmers' love of coffee). When Java was in the hands of the Internet, it became necessary to launch Java applets — small programs downloaded via the Internet. WebRunner was renamed HotJava and Netscape started supporting Java products.

Java applets

Each applet is a small program dynamically loaded over the network - just like a picture, sound file, or animation element. The main feature of applets is that they are real programs, and not just another file format for storing cartoons or any other information. An applet does not just lose the same scenario, but reacts to user actions and can dynamically change its behavior.

It was the flashy animated Web pages that attracted most of the early adopters of the Java language. Since users were not immediately able to fully master the most revolutionary aspects of Java, this language was often compared with other technologies for uploading dynamic images and simple interaction with Web clients. Companies traditionally engaged in the development of multimedia technologies, such as Adobe or MacroMedia, argued that their products provide the same features as Java. According to Kaleida, Taligent and NeXT, their own object-oriented development environments were no less revolutionary. Microsoft announced the victory of technology a decade ago. In fact, nothing can compare with what you discover for yourself by feeling the power of programming in the Java language.

The ability to specify any levels of user interaction exists only when the platform used for development provides a fully functional programming environment.

Revolutionary programming language

The language had to embody the following qualities: simplicity and power, security, object orientation, reliability, interactivity, architectural independence, interpretability, high performance and ease of learning. Even if you never write a single line in the Java language, knowing about its capabilities is very useful, since it is the properties of the language listed above that give dynamics to the World Wide Web pages.

Simplicity and power

After mastering the basic concepts of object-oriented programming, you will quickly learn how to program in Java. Nowadays there are many programming systems that are proud of the fact that they can achieve the same goal in a dozen different ways. There is no abundance of solutions in the Java language - for solving the problem you will have very few options. The quest for simplicity often led to the creation of inefficient and inexpressive languages ​​such as command interpreters. Java is not one of these languages ​​- for you all the power of OOP and class libraries.

Security

In today's popular literature, especially when it comes to the Internet, the discussion of security issues has become a fashionable topic. People are convinced that using the Internet in commercial activities is tantamount to writing their credit card number on the wall of a telephone booth. One of the key principles behind the development of the Java language was to protect against unauthorized access. Java programs cannot invoke global functions and access arbitrary system resources, which provides a level of security in Java that is inaccessible to other languages.

Object orientation

It is amusing to observe how numerous new dialects of old languages ​​are categorically declared object-oriented. Since there was no heavy heredity in the development of the language, a convenient pragmatic approach was chosen to implement the objects. Java developers tried to maintain a reasonable compromise between the model of purists - “everything is objects”, and the model of hackers - “get out of my way”. The object model in Java is simple and easy to expand; at the same time, for the sake of performance, numbers and other simple Java data types are not objects.

Reliability

Java restricts you to several key areas and thus contributes to the detection of errors in the early stages of program development. At the same time, it lacks many sources of errors inherent in other programming languages ​​(strong typing, for example). Most of the programs used today are “denied” in one of two situations: when allocating memory, or when exceptional situations arise. In traditional programming environments, memory allocation is quite a tedious task - the programmer has to keep track of all the memory used in the program, not forgetting to free it as the need for it disappears. Programmers often forget to free the memory they have captured, or, even worse, they release the memory that is still being used by some part of the program. Exceptional situations in traditional programming environments often arise in such cases, for example, as division by zero or an attempt to open a non-existent file, and they have to be processed with clumsy and unreadable constructions (except Delphi). Java actually removes both of these problems by using the garbage collector to free up unallocated memory and the built-in object-oriented tools for handling exceptions.

Interactivity

Java was created as a tool that should satisfy the urgent need for creating interactive network programs. Java provides several interesting solutions that allow you to write code that simultaneously performs a lot of different functions and does not forget to keep track of what should happen and when. In Java, the most elegant method ever invented has been used to solve the problem of process synchronization, which allows us to construct excellent interactive systems. Graceful Java subprocesses that are easy to use make it possible to implement concrete behavior in a program, without being distracted by embedding global cyclic event handling.

Computer architecture independence

The question of the longevity and portability of the code is more important than the religious wars between PCs and Macs. The creators of Java imposed several stringent requirements on the language and the runtime environment, which in practice, not in words, allow, once written, to always run the program anywhere and at any time (where there is a Java virtual machine — browsers on all platforms, OS / 2, Netware).

Interpretation plus high performance

The extraordinary ability of Java to execute its code on any of the supported platforms is achieved by the fact that its programs are translated into a kind of intermediate representation called bytecode. Bytecode, in turn, can be interpreted in any system that has a Java runtime environment. Most of the early systems in which they tried to ensure platform independence had a huge disadvantage — loss of performance (Basic, Perl). Despite the fact that Java uses an interpreter, the byte code is easily translated directly into native In (comp ”) machine codes on the fly. It achieves very high performance (Symantec JIT is built into Netscape Navigator).

Ease of learning

The Java language, although more complex than command interpreter languages, is still immeasurably easier to learn than other programming languages, such as C ++. The features of the language will begin to seem to you as a natural way to solve certain problems and will help develop a good programming style. Since the object model in Java is both simple and expressive at the same time, you will soon become familiar with the object-oriented style of creating programs.

Rich object environment

The Java environment is much more than a programming language. It has a built-in set of key classes containing basic real-world abstractions that your programs will have to deal with. The basis of Java popularity is the built-in abstraction classes that made it a language that is truly platform independent. Libraries like MFC / COM, OWL, VCL, NeXTStep, Motif and OpenDoc work fine on their platforms, but today the Internet is becoming the main platform.

There are 23 packages in the Java 1.1.6 implementation (there were 8 of them in Java 1.0.2), and the number of classes is 503 (211). Now in its final stage of beta testing JDK 1.2. For those who are going to support Java 1.0 along with 1.1 (Borland JBuilder 2.0 and other products confirm the relevance of this support), the innovations 1.1 are specifically highlighted in Appendix 2 .

Table 1

Java API Packages

Package name

Content

java.applet

Classes for implementing applets

java.awt

Classes for working with graphics, text, windows and GUI

java.awt.datatransfer

Classes to provide information transfer (Copy / Paste)

java.awt.event

Classes and Interfaces for Event Handling

java.awt.image

Image Processing Classes

java.awt.peer

GUI for platform independence

java.beans

API for the JavaBeans component model

java.io

Classes for various types of I / O

java.lang

Language core classes (types, work with strings, trigonometric functions, exception handling, lightweight processes)

java.lang.reflect

Reflection API Classes

java.math

Classes for arbitrary precision arithmetic operations

java.net

Classes for work on the Internet (sockets, protocols, URL)

java.rmi

Classes Related to RMI (Remote Procedure Call)

java.rmi.dgc

RMI related classes

java.rmi.registry

RMI related classes

java.rmi.server

RMI related classes

java.security

Safety classes

java.security.acl

Safety classes

java.security.interfaces

Security Classes

java.sql

java.text

Classes to provide multilingual support

java.text.resources

Classes to provide multilingual support

java.util

Miscellaneous useful data types (stacks, dowels, hash tables, dates, random number generator)

java.util.zip

Classes for archiving

We will consider a part of these packages in great detail (this can be seen from the table of contents), the other will be used for independent study.

LITERATURE

  1. Noton P.JAVA: Reference Guide: Trans. Of English / Edited by A.Tikhonov-M.: BINOM: Vostochn.Kn.Kompaniya, 1996: Vostochn.Kn.Kompaniya.-447с ..- (Club Computer )
  2. Patrick Naughton, Herbert Schildt The Complete Java Handbook .- McGraw-Hill, 1997, Dialectics, 1997
  3. Дэвид Флэнэген Java in a Nutshell.- O'Reilly & Associates, Inc., 1997, Издательская группа BHV, Киев, 1998
  4. Ренеган Э.Дж.(мл.)1001 адрес WEB для программистов:Новейший путеводитель программиста по ресурсам World Wide Web:Пер.с англ..-Минск:Попурри,1997.-512с.ил.
  5. Сокольский М.В.Все об Intranet и Internet.-М.:Элиот,1998.-254с.ил.
  6. Чен М.С. и др.Программирование на JAVA:1001 совет:Наиболее полное руководство по Java и Visual J++:Пер.с англ./Чен М.С.,Грифис С.В.,Изи Э.Ф..-Минск:Попурри,1997.-640с.ил.+ Прил.(1диск.)
  7. Майкл Эферган Java: справочник.- QUE Corporation, 1997, Издательство "Питер Ком", 1998
  8. Джо Вебер Технология Java в подлиннике.- QUE Corporation, 1996, "BHV-Санкт-Петербург",1997
  9. Джейсон Мейнджер Java: Основы программирования.- McGraw-Hill,Inc.,1996, Издательская группа BHV, Киев,1997
  10. И.Ю.Баженова Язык программирования Java.- АО "Диалог-МИФИ", 1997
  11. Джон Родли Создание Java-апплетов.- The Coriolis Group,Inc.,1996, Издательство НИПФ "ДиаСофт Лтд.",1996
  12. Майкл Томас, Пратик Пател, Алан Хадсон, Доналд Болл(мл.) Секреты программирования для Internet на Java.- Ventana Press, Ventana Communications Group, USA,1996, Издательство "Питер Пресс", 1997
  13. Аарон И.Волш Основы программирования на Java для World Wide Web.- IDG Books Worldwide,Inc.,1996, Издательство "Диалектика",1996
  14. Кен Арнольд, Джеймс Гослинг Язык программирования Java.- Addison-Wesley Longman,USA,1996, Издательство "Питер-Пресс", 1997
  15. Нейл Бартлетт, Алекс Лесли, Стив Симкин Программирование на Java. Путеводитель.- The Coriolis Group,Inc.,1996, Издательство НИПФ "ДиаСофт Лтд.",1996
  16. Chris Jams Library programmer Java.- Jamsa Press, 1996, LLC "Potpourri", 1996
created: 2014-09-30
updated: 2021-03-13
132912



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Programming Languages and Methods / Translation Theory

Terms: Programming Languages and Methods / Translation Theory