Programming

Tech - Programming
By: - at June 6, 2013

Introduction to Java EE (Part 1)

Java EE LogoWhat is Java EE ?

Java EE is not Java.  The term "Java" evidently referring to a language, but also a platform: His full name is "Java SE" for Java Standard Edition, and was formerly shortcut "J2SE". It consists of many libraries or APIs: For example java.lang, java.io, java.math, java.util, etc.. In short, all these libraries you should already know that contain a significant number of classes and methods ready to perform all kinds of tasks.  For more on Java, check out Introduction to Design Patterns.

The term "Java EE" means Java Enterprise Edition, and was formerly shortened to "J2EE". Meanwhile it makes reference to an extension of the standard platform. In other words, the Java EE platform is built on Java and the Java SE platform language, and it adds a lot of libraries completing a whole lot of features that the standard platform does not meet in origin. The main objective of Java EE is to facilitate robust and distributed web application development, deployment and running on an application server. Java EE is not JavaScript

While Java EE allows the creation of web applications, it does not take much to be confused with Javascript, often shortened to "JS", which is also heavily used in web applications. These are two completely different languages, whose only resemblance are their name. So do not kid yourself, and when you hear of scripts Java , remember that it simply refers to the Java code, and especially not the Javascript code.

Above all, we must not confuse the internet and the web:

  • Internet is the network, the physical medium of information. It is a set of machines, cables and network items of all kinds scattered across the globe;
     
  • The web is only a portion of the content available on the internet. You know and use other content, such as email or instant messaging.

A website is a set of web pages (themselves made ​​of HTML, CSS, JavaScript files, etc..). When developing and publishing a website, it actually puts online content on the internet. There are two types of sites:

  • Static websites: These are sites whose content is "fixed", it can only be changed by the site owner. They are made using HTML, CSS and Javascript technologies only.
     
  • Dynamic websites: These are sites whose content is "dynamic" because the owner is not the only one who can make a change! In addition to the languages ​​mentioned above, they involve other technologies: Java EE is one of them!

When a user visits a site, what happens behind the curtain is a simple exchange between a client and a server.

  • The customer: In most cases, it is the browser installed on your computer. Remember that this is not the only way to access the web, but it is the one that interest us in this article.
     
  • Web ServerServer: This is the machine on which the site is hosted, where the files are stored and web pages are generated.

The communication that takes place between the client and the server is governed by well-defined rules: The HTTP protocol . Let us give more detail, and look what has been a simple exchange:

  • The user enters a URL in the address bar of your browser;
     
  • The browser sends an HTTP request to the server asking for the page;
     
  • The server receives the request, the interpreter and then generates a web page that goes back to the client through an HTTP response;
     
  • The browser receives this response through the final web page that displays to the user.

What to understand and remember of all this:

  • Data is exchanged between the client and server via HTTP;
     
  • The client understands only presentation languages ​​of information, in other words the HTML, CSS and Javascript technologies;
     
  • Pages are generated on the server dynamically from the source code of the site.

How does it work?
The customer only receives web pages, display the user's actions and transmits it to the server. You already know that the languages used to format the data and display it to the user are HTML, CSS and possibly JavaScript. They have an important common feature: They are interpreted by the browser directly on the client machine. Moreover, the client is only able to understand these few languages, nothing more! The server also has technologies of his own, that only him can understand: A full battery with the ultimate goal of generating web pages to send to the client, with all treatments that it may involve to the passage: Analysis data received via HTTP, processing data, storing data in a database or files, data integration in the design.

But unlike of HTML & CSS couple which ​​is a must standard for formatting web pages, there are several technologies that can process the information on the server. Java EE is one of them, but there are others: PHP, NET, Ruby on Rails and Django, to mention only the main ones.

How to choose the technology best suited to your project?
It is indeed a very good question: How to decide among this range of possibilities? This debate is almost endless. However, in real life the choice is often influenced or dictated by

  • Your own experience, if you have already developed in Java, Python or C # before, it seems prudent to point respectively to Java EE , Django and NET.
     
  • Your needs: development speed, low resource usage on the server, responsive community supporting technology, the extent of documentation available online, cost, etc.

Principles of operation
HTTP SymbolWe have discovered that in order to communicate, the client and the server must talk through HTTP. We already know that to the client side, the browser takes care of. On the server side, which is in charge? It is a component that is logically called HTTP server. His job is simple: it must listen to everything that happens on the port used by the HTTP protocol on port 80, and scrutinize every incoming request. That's all he's doing. It is basically a communication interface with the protocol.

Being able to talk via HTTP is good, but our server should allow performing other tasks. Indeed, once the HTTP request read and analyzed, we must also treat its contents and possibly return a response to the client accordingly. You probably already know that this is largely your responsibility: The code you write will decide what to do when such a request is coming! But as I tell you this, a standard HTTP server can not handle your application, it is not his job.

We need a more comprehensive solution: This component, which will be responsible to run your code in addition to the work of the HTTP server, is called the application server. Give an exact definition of the term is difficult. What we can remember is that this server includes an HTTP server, and adds the management of various types of objects through a component that we will for now appoint the container.

Specifically, the application server will:

  • Retrieve HTTP requests from clients;
     
  • Put them in boxes, objects, that your code will be able to handle;
     
  • Get these items in the mill that is your application via the container;
     
  • Return HTTP responses to the clients, based on objects returned by your code.

Again, there are several on the market that can be cut into two sectors:

  • Owners and paid solutions: WebLogic and WebSphere, respectively derived from Oracle and IBM ,are the references in the field. Used extensively in the banking and finance in particular, they are both strong, finely configurable and very expensive.
     
  • Free solutions: Apache Tomcat, JBoss, GlassFish and Jonas are the main representatives.

How to choose among all these solutions?
Apart from the issues of costs that are obvious, other parameters may influence your decision include for example the speed of loading and execution, as well as the amount of supported technologies. In our case, we start from zero: For example, a light and free basic application server, will be good. There is just one that meets all our needs perfectly: Apache Tomcat.


 

 

 

 

Programming
Introduction to Java EE (Part 1)
How the Google App Engine Works
WSDL - Web Service Description Language
SOAP: Simple Object Access Protocol
Initiation to Cryptography and Encryption to Secure Data
Introduction to Design Patterns in Java
How To Write Efficient Programs in Java
Proper Management of Logs in .Net
How To Remove FaceBook Action Ids From URL


Copyright 2017 YurTopic All rights reserved.

Protected by Copyscape Online Plagiarism Software

There has been a total of

hits counter
Unique Visitors to YurTopic
(Since January 1st 2013)

About  |  Terms and Conditions  |  Contact