The document provides an overview of Java including its features, editions, and advanced topics. Java is an object-oriented language that is simple, portable, platform independent, and robust. It discusses Java SE, Java EE, web and application servers, and Java EE applications.
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
22 views
Introduction To Java & Advanced Java
The document provides an overview of Java including its features, editions, and advanced topics. Java is an object-oriented language that is simple, portable, platform independent, and robust. It discusses Java SE, Java EE, web and application servers, and Java EE applications.
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23
Introduction to Java
& Advanced Java
Features of Java A list of most important features of Java language is given below. •Simple •Object-Oriented •Portable •Platform independent •Secured •Robust •Architecture neutral •Interpreted •High Performance •Multithreaded •Distributed •Dynamic Features of Java • Simple • Java is very easy to learn, and its syntax is simple, clean and easy to understand. • Object-oriented • Java is an object-oriented programming language. Everything in Java is an object. Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behavior. • Basic concepts of OOPs are:
Object Class Inheritance
Polymorphism Abstraction Encapsulation
Features of Java • Platform Independent Features of Java Secured •Java is best known for its security. Java is secured because: •No explicit pointer •Java Programs run inside a virtual machine sandbox Robust •Robust simply means strong. Java is robust because: •It uses strong memory management. •There is a lack of pointers that avoids security problems. •There is automatic garbage collection in java which runs on the Java Virtual Machine to get rid of objects which are not being used by a Java application anymore. •There are exception handling and the type checking mechanism in Java. All these points make Java robust. Features of Java High Performance: •Java code is compiled into bytecode which is highly optimized by the Java compiler, so that the Java virtual machine (JVM) can execute Java applications at full speed. Multithreaded: •The Java platform is designed with multithreading capabilities built into the language. That means you can build applications with many concurrent threads of activity, resulting in highly interactive and responsive applications. Features of Java • Architecture-neutral − Java compiler generates an architecture-neutral object file format, which makes the compiled code executable on many processors, with the presence of Java runtime system.
• Portable − Being architecture-neutral and having no
implementation dependent aspects of the specification makes Java portable. Features of Java • Interpreted − Java byte code is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light-weight process. • Distributed − Java is designed for the distributed environment of the internet. • Dynamic − Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time. Java SE and Java EE • Java technology is both a programming language and a platform. • The Java programming language is a high-level object-oriented language that has a particular syntax and style. • A Java platform is a particular environment in which Java programming language applications run. • There are several Java platforms. Java SE (Standard Edition) • Java SE's API provides the core functionality of the Java programming language. • J2SE can be used to develop client-side standalone applications or applets. • It defines everything from the basic types and objects of the Java programming language to high-level classes that are used for networking, security, database access, graphical user interface (GUI) development, and XML parsing. • In addition to the core API, the Java SE platform consists of a virtual machine, development tools, deployment technologies, and other class libraries and toolkits commonly used in Java technology applications. Java EE (Enterprise Edition) • The Java EE platform is built on top of the Java SE platform. • The Java EE platform provides an API and runtime environment for developing and running – large-scale – multi-tiered – scalable – reliable – secure network applications Java EE • Java Platform, Enterprise Edition is one of the most powerful ways of developing Multitiered web applications. • The J2EE platform uses a distributed multitiered application model for enterprise applications. • Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier to which the application component belongs. • Client Tier – Components of Client Tier will run in the client devices / containers. Client Tier components are standalone java applications, static and dynamic HTML pages, and applets. • Middle Tier – Web Tier – The web tier components namely JSP’s and Servlets execute with the help of J2EE web server in a web container. – Business Tier – Enterprise Java Beans (EJB) are the business tier components that are executed within the EJB container using J2EE Application Server. • Data/EIS Tier – In the EIS tier, the application related data are stored in a database. EIS tier may also include ERP’s or legacy systems that can be accessed via an API representing Java EE Connector Architecture. • (EIS – Enterprise Information System) Advanced Java Topics • Networking • Java Database Access (JDBC) • Servlet • Java Server Pages (JSP ) • Java Server Faces (JSF) • Hibernate • Spring MVC Web Server vs. Application Server • Web Server is designed to serve HTTP Content. App Server can also serve HTTP Content but is not limited to just HTTP. It can be provided other protocol support such as RMI/RPC • Web server is supposed to provide http protocol level service while application server provides support to web service and expose business level service e.g. EJB. • Web Server is mostly designed to serve static content, though most Web Servers have plugins to support scripting languages like Perl, PHP, ASP, JSP etc. through which these servers can generate dynamic HTTP content. • Web server: Apache Tomcat, Jetty • Application Server: JBoss, WebLogic, WebSphere or Glassfish Web Server vs. Application Server • Most of the application servers have Web Server as integral part of them, that means App Server can do whatever Web Server is capable of. Additionally App Server have components and features to support Application level services such as Connection Pooling, Object Pooling, Transaction Support, Messaging services etc. • As web servers are well suited for static content and app servers for dynamic content, most of the production environments have web server acting as reverse proxy to app server. • That means while servicing a page request, static contents (such as images/Static HTML) are served by web server that interprets the request. Using some kind of filtering technique (mostly extension of requested resource) web server identifies dynamic content request and transparently forwards to app server Apache Tomcat • Tomcat is a web server and a web container(Servlet/JSP) container. It is often used as an application server for strictly web-based applications but does not include the entire suite of capabilities that a Java EE application server would supply. • Servlet container provides only servlet/jsp part of JEE Specification, not complete (example is tomcat). Whereas JEE application server will provide complete JEE specification including EJB (examples are JBoss and Weblogic). • We cannot deploy EAR files to Tomcat. That makes it a non-application server. Java EE application • A Java EE application or a Java Platform, Enterprise Edition application is any deployable unit of Java EE functionality. • This can be a single Java EE module or a group of modules packaged into an EAR file along with a Java EE application deployment descriptor. • Java EE applications are typically engineered to be distributed across multiple computing tiers. Java EE application Enterprise applications can consist of combinations of the following: •Enterprise JavaBean (EJB) modules (packaged in JAR files); •Web modules (packaged in WAR files); •connector modules or resource adapters (packaged in RAR files); •Session Initiation Protocol (SIP) modules (packaged in SAR files); •application client modules; •Additional JAR files containing dependent classes or other components required by the application • A WAR (Web Archive) is a module that gets loaded into a Web container of a Java Application Server. A Java Application Server has two containers (runtime environments) - one is a Web container and the other is a EJB container. • The Web container hosts Web applications based on JSP or the Servlets API - designed specifically for web request handling - so more of a request/response style of distributed computing. A Web container requires the Web module to be packaged as a WAR file - that is a special JAR file with a web.xml file in the WEB-INF folder. • An EJB container hosts Enterprise java beans based on the EJB API designed to provide extended business functionality such as declarative transactions, declarative method level security and multiprotocol support - so more of an RPC style of distributed computing. EJB containers require EJB modules to be packaged as JAR files - these have an ejb-jar.xml file in the META-INF folder. • Enterprise applications may consist of one or more modules that can either be Web modules (packaged as a WAR file), EJB modules (packaged as a JAR file), or both of them. Enterprise applications are packaged as EAR files ― these are special JAR files containing an application.xml file in the META-INF folder. • Basically, EAR files are a superset containing WAR files and JAR files. Java Application Servers allow deployment of standalone web modules in a WAR file, though internally, they create EAR files as a wrapper around WAR files. Standalone web containers such as Tomcat and Jetty do not support EAR files ― these are not full- fledged Application servers. Web applications in these containers are to be deployed as WAR files only. • In application servers, EAR files contain configurations such as application security role mapping, EJB reference mapping and context root URL mapping of web modules. • Apart from Web modules and EJB modules, EAR files can also contain connector modules packaged as RAR files and Client modules packaged as JAR files.