Web Concepts and Technologies / Java
Subtitles of the Movie
Much has been said about Java over the last few years ever since it was released by Sun Microsystems, the way the press went on, you’d think it was the new Netscape or something. Not many people actually know what Java is. Let’s have a look at that now. Java is a programming language. And when I say a programming language, this time I mean it's a real programming language. In other words not a scripting language and it’s used to put little tiny programs, mini programs or what we call applets within a web page. I say mini programs because we’re not really talking about putting a full scale say word processor or spread sheet program or some kind of database package inside a web page, we’re talking about small programs. We’re adding small functionality to a web page. Well I guess we’re adding about as much functionality as a web page could reasonably have. Because Java is a ‘real’ programming language, I use the word real in inverted commas here, it does take quite a bit of learning. If you've never programmed before, it would probably take you many months to learn how to competently program in Java. If you've programmed in C++ it wouldn't take you very long at all because Java is actually a derivative of C++ developed by Sun Microsystems. If you've programmed in C, similarly you will not have too much trouble migrating to Java or C++ for that matter. So if Java is a programming language and it’s similar to C++, why did it get so much hype, so much media attention and so much attention on the Internet? The strength of Java is that it is a multi platform language. What this means is it will run on any operating system. Any operating system that is, that has a Java virtual machine and because you get a Java virtual machine bundled with both Internet Explorer and Netscape Navigator and Internet Explorer and Netscape Navigator run on just about every sort of desktop operating system there is, you’ll have a Java virtual machine on just about every desktop operating system there is. What this means is that your programmer who wants to write a program, can write it in just one language, they don't have to port it to multiple different operating systems. If a programmer wants to write a program, one of the first decisions they have to make is what operating system is this program going to run on. Then I’d say, well it's going to run on a Macintosh or it’s going to run on Windows, what version of Windows? Is it going to be Windows 95 or Windows NT or Windows 3.1 or is it going to run on OS 2 or Unix or DOS or AS400 or some other kind of operating system. They might think to them selves, well I actually like it to run on all operating system, wouldn't that be great? Then I could sell it to more people. But it's usually not as easy as that; they can't just decide to have it run on multiple operating systems without a considerable amount of reprogramming for each operating system. This reprogramming or porting or recompiling as it’s known is quite time consuming and therefore costly. So most programmers don't undertake it, they simply decide that they’re going to write their program for one operating system and usually choose the most popular such as Windows 95 or something like that. When Java came along, the programming population rejoiced because they could write a program in one language and then it would able to be run on just about every operating system. And this is where the media hype came in. what the media hype failed to take into consideration was Java programs usually run quite slowly in comparison to their say C or C++ counterparts. Also if you’re going to write a program that runs on every operating system, then you can only take advantage of features that are available on every operating system, so the feature set of your program that you write, will probably be quite small. It's called the lowest common denominator approach. Anyway I hope that goes someway to explaining to you what Java is, you as a web developer have the options to add Java applets to your web pages but in order to do that you will either have to develop them yourself which means you'll have to be a Java programmer which is a considerable amount of work or you'll have to get someone else do it for you or buy them or something, so it could be expensive. When a Java program is run, it runs as follows. Firstly, the web page is loaded in a browser, that web page, that HTML page will probably contain a reference to the Java program. So the web browser will then contact the web server on which the Java program resides and will download the Java program, it downloads actually what we call a precompiled Java code. Now it's downloading an entire program, so this can take some time if the program is a large program. Once the program has been downloaded, it's run within the web page using the Java virtual machine. Now I’m not going to go into that in any more detail but what you end up is a little window inside your web page in which the program’s running. What's important to note is that the program is running on your machine, it’s running on the browser, in other words this is client side processing. The program is not run on the server, it’s run on the client. Let’s have a look at an example of a Java program running. Before I show you that I’m going to ask you what sort of things do you think you could do with a Java program? What do you think you could do with Java? We've seen CGI scripts, and they, well they’re functional, they’re quite functional, you can do some quite useful things with them but you can’t do anything with them and that's one of the marvelous things about Java is you can do virtually anything, you can take what would otherwise be a very static web page and you can interact with it in anyway you like. You can play a game if you like and that's the example I’m going to show you. You could even play Tetris. This is a web page in which Tetris is running as a Java program. Now this is not something you could do in a normal web page. Considerable amount of programming effort has been put in to this particular web page to write a Java program to run within it and I‘ll just give you a quick demonstration of this. This is not something you could do with a normal web page. It’s running full screen at the moment so that I could fit the whole Tetris application and it’s as you can see, you know this is more functionality that you would get in a typical web page because it's a program, it's a full on program running. in my web page and you get the general idea. If you think this is kind of cute, I’ll put a link, I’ll put a copy of the link to this page in the links page that comes with this course. Sorry it's a little bit difficult there to concentrate on teaching you all about Java and playing Tetris at the same time so I had to bomb out of that. The salient thing to take away from that little demonstration is that Java programs can do anything. You’re not restricted to simple forms, filling in text boxes, looking at pictures; you can actually make them do anything you like. My bank, the bank that I bank with, which is the National Australia bank that has a Java program which it uses to do it’s internet banking facility where I can view my balances, make payments to pay my bills, transfer monies to other accounts and so on and that's all done in Java, it’s probably the most sophisticated Java program that I’ve seen. That's at www.national.home.au but you’ll have to have a bank account with them if you want see their Internet banking facility. Anyway enough about Java, let’s move on.
Tutorial Information
| Course: | Web Publishing and Publicizing |
| Author: | Mark Virtue |
| SKU: | 33298 |
| ISBN: | 1930519729 |
| Release Date: | 2002-03-11 |
| Duration: | 6 hrs / 61 lessons |
| Work Files: |
Yes |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 