Friday, October 26, 2018

5 main features of JDK 7

What's new in Java or JDK 7

It's been almost a year since JDK 7 or Java 7 was released, but the programmer asks what's new in Java 7? What is the best resource introduced in JDK7, where is the list of all the new Java 7 features, etc? I have thought about documenting the 5 main features introduced in Java 7 for easy reference, this will not only answer what's new in Java 7, but it will also provide a quick overview of what these features are in Java 7. Java 7 introduced Many new features of Java programming language such as trying to capture with a resource, String on the switch, etc., but also makes a lot of change in the Java development API, introducing the new API files in Java and other small changes. For example. Now you can find hidden files of the Java program without applying any hack. Anyway, let's see my list of the 5 main features of Java 7:

The 5 new new features of Java 7

Here are my Top 5 new favorite Java 7 features introduced in the Java programming language in version 7. There are many other features in Java 7 that are introduced along with these front line features, such as changes to the File API, that also deserve to be exploited



Interested in learning Java? Join now:” java training in chennai “

Allow to use chain in case of switching

You can not use String in Switch or case statement before Java 7. Talk about allowing String in the case of Switch was growing since Enum was introduced in Java 5, although you can use Enum in the case of Switch, you can not do what same with String which is more common than Enum in the Java programming language. of the JDK 7 you can use the String in Switch case, see How to use the String in Switch case in Java7 for more details.

Multiple Exception in a catch block

This is the first resource that comes in my mind when people ask What's new in the Java 7 resource? Can you cite some new features introduced in the release of JDK 7? From JDK 7, you can capture several Exceptions in a catch block. This is called the blocking feature of multiple Java 7 captures. This is a significant improvement of Java 7 made in the Exception handling because it will reduce the confusion in the Java Exceptions handling code. To learn how to capture several exceptions in the catch block once in Java 7, see this article. Explains this new feature of Java 7 beautifully.


Automatic management of resources or ARM blocks

Like the previous Java 7 function, automatic resource management (ARM blocks) also known as try with resource block is another significant improvement in the area of exception manipulation in Java. The ARM blocks allow the automatic closing of resources, for example Files, Flows, etc., opened within the try block. The functionality must implement the Closeable interface in Java. See how to use the ARM block in Java 7 for more details.

Interested in learning Java? Join now:” java training in bangalore “

Fork binding structure in Java 7

Another new feature that you can use to answer the question of the Java interview What's new in Java 7? The fork binding framework exists even before Java 7, but as a separate JSR. It has been added as a new feature in Java 7 to be part of the standard Java 7 main library. The fork binding structure allows writing code that can take advantage of several cores present in modern servers. See How to use the bifurcated link structure in Java 7 for code example and guidance on the use of the fork joint structure.

Diamond operator <> for type inference

Since Java 5 introduced Generics in Java, programmers complain that they are very detailed and generate duplicate code, which is true because when creating a java parameterized class object you need to provide type parameters on the left and right side. The diamond operator <> is a new Java 7 feature that provides type inference when creating generic class objects. Although you can achieve type inference without using Java 7, by creating the Factory method in Java, the Diamond operator is an easy way to get type inference in Java 7.

This was my list of the 5 new new features introduced in Java 7 and now you can reply What's new in Java 7. These were some of the most popular new features of JDK 7. Many production systems are still running in several updates to JDK 6 But I guess they're also slowly updating to Java 7. Now, even talking about Java 8 is growing, because you can enter closures in Java, which was previously planned to be released in Java 7 along with these new ones resources.




Thursday, October 25, 2018

Java Technologies for Web Applications

What Is a Web Application?

Description:
Web applications are, by their nature, distributed applications, which means that they are programs executed on more than one computer and communicate through a network or server. In particular, web applications are accessed with a web browser and are popular due to the ease of using the browser as a user client. For the company, the ability to update and maintain unimplemented web applications and install software potentially thousands of client computers is one of the main reasons for its popularity. Web applications are used for webmail, online retail sales, discussion boards, weblogs, online banking services and much more. A web application can be accessed and used by millions of people.

Like desktop applications, Web applications are composed of many parts and generally contain mini-programs, some of which have user interfaces and some of them do not require a graphical user interface (GUI). In addition, Web applications often require an additional markup language or script, such as HTML, CSS or JavaScript programming language. In addition, many applications only use the Java programming language, which is ideal due to its versatility.

A web application can be as simple as a page that shows the current date and time or as complex as a set of pages in which you can search and book the most convenient flights, hotels and car rentals for the next vacation.

The Java technologies that you will use to create web applications are part of the Java EE platform, as well as many classes and packages of the Java platform, Standard Edition (Java SE). For many of these technologies to work on a server, the server must have a container or Web server installed that recognizes and executes the created classes. To develop and test these technologies, you can use the tools detailed in this article, but when deploying, verify that the server has Java server software installed to run web applications based on Java technology. If you do not have access to this information, ask the server administrator.



Java technologies for use in Web applications

There are many Java technologies to list in an article, so this article will only describe the most used ones. The number of technologies listed here can seem overwhelming. Keep in mind that you will not have to use all of them. In reality, a web application usually consists of nothing more than a page created with JavaServer Pages (JSP) technology. Sometimes three or more of these technologies are combined. No matter how many you end up using, it is good to know what is available to you and how you can use each of them in a web application.

Java servlet API

The Java Servlet API allows you to define specific HTTP classes. A servlet class extends the resources of servers that host applications that are accessed through a response request programming model. Although servlets can respond to any type of request, they are commonly used to extend applications hosted by web servers.

For example, you can use a servlet to get the text input of a form online and print it on the screen in an HTML page and format, or use a different servlet to write the data to a file or database. A servlet runs on the server side - without an application GUI or its own user interface (UI) HTML. Java Servlet extensions make many web applications possible.

The javax.servlet and javax.servlet.http packages provide the classes and interfaces to define the servlets. The HTML servlet classes extend the abstract class javax.servlet.http.HttpServlet, which provides a structure for manipulating the HTTP protocol.

JavaServer Pages technology

JavaServer Pages (JSP) technology provides a simplified and fast way to create dynamic Web content. JSP technology allows the rapid development of web-based applications that are independent of the server and the platform. JSP technology allows you to add servlet code snippets directly into a text-based document. Normally, a JSP page is a text-based document that contains two types of text:
• Static data, which can be expressed in any text-based format, such as HTML, Markup Markup Language (WML) or XML


JSP technology elements, which determine how the page builds dynamic content
The packages involved in creating JSP pages are javax.el, javax.servlet.jsp, javax.servlet.jsp.el ejavax.servlet.jsp.tagext, although you rarely have to import directly. A JSP page can be as simple as a bit of HTML with a JSP snippet and the .jsp extension of the page name.

For example, you can create a JSP technology page site that uses a snippet of code to include the header.html file, which contains the site navigation. In this way, when a link is changed to a button in the navigation, a change is made to a file and this file is loaded in all the pages of the site that have this code fragment:
<% @ include file = "header.html"%>

This line of code works a lot like a server-side inclusion if you're familiar with them. Since this web page is now a JSP page, you can also add more Java technology code to create dynamic Web content, such as surveys, forms, ways to insert or retrieve data from a database, and so on.

JavaServer Pages Standard tag library

The JavaServer Pages standard tag library (JSTL) encapsulates the main functionality common to many applications based on JSP technology. Instead of mixing tags from multiple vendors in your applications, a single set of standard tags is used. This standardization allows you to implement your applications in any JSP container that supports the JSTL and increases the likelihood that the implementation of the tags will be optimized.

The JSTL has iterative and conditional tags to manipulate flow control, tags to manipulate XML documents, internationalization tags, tags to access databases using SQL, and tags for commonly used functions.

The packages that you can access to use JSTL are javax.servlet.jsp.jstl.core, javax.servlet.jsp.jstl.fmt, javax.servlet.jsp.jstl.sql and javax.servlet.jsp.jstl.tlv.

JavaServer Pages Faces Technology

JavaServer Faces technology is a user interface structure for the creation of web applications. The main components of JavaServer Faces technology involve a structure of GUI components, a flexible model to represent components in several languages and marking technologies and a standardRenderKit to generate HTML markup.

This functionality is available through standard Java APIs and XML-based configuration files. In addition, the Sun Java Studio Creator IDE leverages JavaServer Faces technology in its drag-and-drop GUI tools, allowing you to use the technology without having to write or understand the underlying code.

Java Message Service API

Messages are a method of communication between software components or applications. A messaging system is a peer-to-peer resource. In other words, a messaging client can send and receive messages from any other client. Each client connects to a messaging agent that provides resources to create, send, receive and read messages. By combining Java technology with corporate messages, the Java Message Service (JMS) API provides a powerful tool for solving corporate computing problems.

The corporate messaging system provides a reliable and flexible service for the exchange of business data throughout the company. The JMS API adds to this a common structure of API and provider that allows the development of portable applications based on messages in the Java programming language. An example of how the JMS can be used is an application that tracks the inventory of an automobile manufacturer. The stock component can send a message to the factory component when the inventory level of a product is below a certain level. more cars. The factory component can send a message to the parts components so that the factory can assemble the necessary parts. Parts components can send messages to their own stock and request components to update their stocks and request new supplier parts. in front.

The JMS API improves the productivity of the programmer by defining a common set of message concepts and programming strategies that all messaging systems compatible with JMS technology will support.

JavaMail API and JavaBeans Activation Framework

Web applications can use the JavaMail API to send notifications by email. The API has two parts: an application-level interface that application components use to send email and a service provider interface. Service providers implement specific email protocols, such as SMTP. Several service providers are included in the JavaMail API package and others are available separately. The Java EE platform includes the JavaMail extension with a service provider that allows the components of the application to send email.

In combination with the JavaMail extension, you can use the JAF API (JavaBeans Activation Framework). This API provides standard services to determine the type of an arbitrary part of data, encapsulate access to it, discover the operations available in it and create the appropriate component based on the architecture of the JavaBeans component (JavaBeans component) to perform these operations.
The JavaMail API is now open source. See the GlassFish project - JavaMail home page.

Java API for XML processing

The Java API for XML processing (JAXP), part of the Java SE platform, supports the processing of XML documents through the document object document (DOM), the simple API for XML (SAX) and the translation style extensions of style (XSLT). JAXP allows applications to analyze and transform XML documents, independently of a specific implementation of XML processing.

JAXP also provides namespace support, allowing you to work with schemes that might otherwise have naming conflicts. Designed to be flexible, JAXP allows you to use any XML compatible analyzer or XSL processor within your application and supports the W3C schema.

Interested in learning Java? Join now:” java training in chennai “


JDBC API

The JDBC API allows you to call the SQL commands from the database of the Java programming language methods. You can use the JDBC API in a servlet, a JSP technology page, or a bean company when you have access to the database.
The JDBC API has two parts: an application-level interface that the application components use to access a database and a service provider interface to connect a JDBC driver to the Java EE platform.

The left side of Figure 2 shows how a client makes a direct call to the application server, usually through a servlet or JSP page, and this data is sent to the database management system server (DBMS). The right side of Figure 2 shows how a driver converts JDBC calls into the middleware provider's protocol.



Java Persistence API

Java Persistence API is a standards-based solution of Java technology for persistence. Persistence uses a relational object assignment approach to fill the gap between an object-oriented model and a relational database. The persistence of Java technology consists of three areas:
• The Java persistence API
• The query language
• Relational object assignment metadata
Interested in learning Java? Join now:” java training in bangalore “

Java Naming and Directory Interface

The JNDI (Java Naming and Directory Interface) provides name and directory functionality, allowing applications to access various naming and directory services. It provides applications with methods to perform standard directory operations, such as associating attributes with objects and searching for objects through their attributes. Using JNDI, a web application can store and retrieve any type of named Java technology object, allowing applications to coexist with many legacy applications and systems.
Naming services provide application clients, corporate beans, and web components with access to a JNDI naming environment. A naming environment allows the developer to customize a component without having to access or change the source code of the component. A container implements the environment of the component and provides it to the component as a JNDI nomenclature context.


Other Technologies to Consider
Description:

You may want to consider using the following technologies in your web application, depending on the complexity of the application:
• J2EE Connector Architecture: System vendors and tools providers use this architecture to create resource adapters that support access to corporate information systems that can be connected to any product based on Java EE technology.
• JAAS (Java Authentication and Authorization Service): JAAS provides a way for an application based on Java EE technology to authenticate and authorize a specific user or group of users to execute it.
Java API for XML registries (JAXR): JAXR allows access to business and general purpose records through the web.
• Java architecture for XML Binding (JAXB): JAXB provides a convenient way to link an XML schema to a representation in applications written in the Java programming language.
• SOAP with Attachment API for Java (SAAJ): SAAJ is a low level API on which JAX-WS and JAXR depend.
• Java Transaction API (JTA): The JTA provides a standard interface to demarcate transactions.




Wednesday, October 24, 2018

12 Frameworks Java Web Developers Should learn in 2018

INTRODUCTION

 

In today's world, a good knowledge of several frameworks is very important. They allow you to quickly develop the prototype and the actual design. If you are working in a startup space, you are expected to take something legal in a short time and that is where the knowledge of the framework is excellent.

It also helps you get a better job and take your career to the next level, if you're stuck somewhere working on boring tasks, like just starting and stopping the server, setting up some cron jobs and responding to the same old emails while keeping the job legacy applications.


1) Angular 2+
This is another JavaScript framework, which is on my list of things to learn in 2018. It provides a completely client-side solution. You can use AngularJS to create dynamic Web pages on the client side. It provides declarative models, dependency injection, end-to-end tools and integrated best practices to solve common development challenges on the client side.

Because it is a JavaScript library, you can include this in your HTML page using the <script> tag. It extends HTML attributes with directives and links data to HTML using expressions.

As Google is behind Angular, you can rest easy in terms of performance and regular updates. I firmly believe that AngularJS is here for the long term, so investing time in it is completely justified.


2) Node JS

There is no doubt that JavaScript is the programming language # 1 and the Node.js has a great role to play in it. Traditionally, JavaScript is used as a client scripting language, where it is used with HTML to provide dynamic behavior on the client side. It runs in the Web browser, but Node.js allows you to run JavaScript on the server side.

Tye Node.js is an open source open source open source runtime environment for running server-side JavaScript. You can use Node.js to create dynamic Web pages on the server side before sending them to the client.This means that you can develop a client-server application again in JavaScript.

3) spring boot

I have used the spring frame for many years, so when I was introduced to Spring Boot, I was totally surprised at the relative lack of configuration. Writing a Spring-based Java application using Spring Boot was as simple as writing a main Java application using the main () method.

Although I have experienced the Spring Boot, I still have many things to learn, and that is why it is on my list of things to learn in 2018.

Interested in learning Java? Join now:” java training in chennai “

4) React

React is another library or JavaScript structure to create interfaces with the user. It's like the Angular, but maintained by Facebook, Instagram and a community of developers and individual corporations. It allows Web developers to create large web applications that can change over time without reloading the page.

The world of Web development is divided between the Angular and the React and it is up to you to choose what you choose. Most of the time, it is dictated by the circumstances; For example, if you are working on a project based on React, obviously you will need to learn React.

If you decide to learn the React in 2018, then Pluarlsight's React.js: Getting Started course is a good starting point.

Interested in learning Java? Join now:” java training in bangalore “

5) Bootstrap

This is another popular free software front-end web structure for designing web sites and web applications. First brought to us by Twitter, Bootstrap provides design models based on HTML and CSS for typography, forms, buttons, navigation and other interface components, as well as optional JavaScript extensions.

Bootstrap supports responsible web design, which means that the design of web pages is adjusted dynamically, depending on the size of the browser screen.

In the world of mobile devices, BootStrap is leading the way with its design philosophy for mobile devices, emphasizing a responsive design by default.

If you are a web developer and do not know Bootstrap, 2018 is the right time to start using it. Bootstrap 4 From Scratch is a good starting point for your Bootstrap trip in 2018.

6) jQuery

This is another JavaScript framework that dominates the world. JQuery has been my favorite for a long time and I advise all developers to learn jQuery. It makes the client-side script really easy.

You can make animations, send HTTP requests, load pages and execute client validation by writing just a few lines of code.

7) Spring security 5

There is no substitute for safety and, in 2018, it will be even more important. As Spring Security has become synonymous with web security in the Java world, it makes perfect sense to update with the latest version of Spring Security in 2018.

The new version 5.0 of Spring Security includes many bug fixes and a new full OAuth 2.0 module. Even if you do not know Spring Security, consider learning it in 2018, and there is no better way to enter the Eugen Paraschiv Spring Learning Master Class.

8) Apache Hadoop

Big Data and automation are the focus of many companies in 2018, and that is why it is important for programmers to learn Big Data technologies such as Hadoop and Spark. Apache Hadoop is a framework that allows the distributed processing of large datasets through computer clusters using simple programming models.

It is designed to scale from single servers to thousands of machines, each of which offers local computing and storage. It is based on the popular Map Reduce standard and is essential for the development of a reliable, scalable and distributed software computing application.

9) Apache Spark

This is another Big Data framework that is gaining popularity. Apache Spark is a fast in-memory data processing mechanism with an elegant and expressive development API to allow data professionals to efficiently execute streaming, machine learning or SQL workloads that require quick access to data sets. work data.

You can use Spark for in-memory computing for ETL, machine learning and data workloads for the Hadoop. I have already listed the Apache Spark Fundamentals course of PluralSight to be launched in 2018. If you are on the same boat, you can take the course to get some inspiration.

10) Cordoba

Apache Cordova is another mobile application development framework originally created by Nitobi. Adobe Systems bought Nitobi in 2011, renamed it PhoneGap and then launched an open source version of the software called Apache Cordova.

It allows you to use standard web technologies - HTML5, CSS3 and JavaScript for the development of cross platform, and one of the most advanced technologies to learn in 2018. If you want to learn Cordoba in 2018, check out Build iOS & Android Apps with Angular and Cordova, one of the interesting courses to learn Córdoba.

11) Firebase

Firebase is Google's mobile platform that helps you quickly develop high-quality mobile applications and expand your business. You can choose the Firebase as a back-end for your Android or iOS application.

If you are thinking about entering the profitable business of mobile application development in 2018, learning the Firebase is a good idea, and the advanced iOS and the Firebase: Rideshare are a good place to start.

12) Xamarin

Xamarin is a way to quickly make mobile applications for all platforms with a single shared C # code base, create a custom native user interface for each platform or use Xamarin.Forms to create a single shared user interface between platforms.

It is owned by Microsoft and is fast becoming popular in the creation of mobile applications for C, C ++ and C # developers.

If you already know one of the C languages and are looking for a career in the development of applications for mobile devices, I suggest you learn Xamarin in 2018 and the Xamarin Developer Complete Course: iOS and Android! It's a good way to start.

This is all about what to learn in 2018. These structures are in great demand, mainly Spring, Node.js and AngularJS. Learning these pictures will not only increase your chances of getting a job, but it will also open many doors of opportunity.
Even if you are comfortable with your job, keeping up with the latest and greatest technologies is essential to your career growth.




Tuesday, October 23, 2018

Object-Oriented Design Principles in Java

INTRODUCTION
In this article, we will learn the object-oriented design principles that can be applied in our daily design work. It is important to learn the basics of object-oriented programming, such as abstraction, encapsulation, polymorphism, and inheritance. But, at the same time, it is equally important to know the principles of object-oriented design, to create a clean and modular design. These guidelines help design a strong software design oriented to objects.

First, we will list the important principles of object-oriented design, and we will discuss each guideline in greater detail.


Encapsulate What Varies
• If you know that your code will change in the future, separate.

• The benefit of this OOP design is that it is easy to test and maintain the proper encapsulated code.

• Only one thing is constant in the field of software and that is change. Therefore, encapsulate the code that you expect or suspect of changing in the future.

• If you are coding in Java, follow the principle of making the variable and private methods by default and increasing access, for example, from private to protected and not public. Several of the design patterns in Java use encapsulation. The factory design pattern is an example of encapsulation that encapsulates an object creation code and provides flexibility to introduce a new product later regardless of existing code.

Code to an Interface Rather Than to an Implementation


• Always schedule for an interface and not for the implementation. This will lead to a flexible code that can work with any new implementation of an interface.

• Use the type of interface in variables, method return types or method argument type in Java. This has been recommended by many Java programmers, including books like Java effects and the first style design pattern.
 Delegation Principle

Do not do all things alone, delegate to your class. A good example of the delegation design principle is the equals () method and hashCode () in Java.

• To compare two objects for equality, we ask that the class itself make a comparison instead of the Client class doing that verification. The benefit of this design principle is not the duplication of the code and it is very easy to modify the behavior.

Open-Closed Principle (OCP)


Classes must be open for the extension but closed for modification.

• Classes, methods or functions must be open to the extension (new functionality) and closed for modification.

• The benefit of this object-oriented design principle is to prevent programmers from changing the already tried and tested code.

Dry —Don't Repeat Yourself


• Avoid duplicate code by abstracting common things and placing them in a single location.

• Use an abstract class to abstract common things in one place. If you have a block of code in more than two locations, consider converting it to a stand-alone method or use a coded value more than once, with public static end constants.

• The benefit of this object-oriented design principle is in maintenance.

Interested in learning Java? Join now:” java training in chennai “

Single Responsibility Principle (SRP)


• All the objects in our web application must have a single responsibility, and all the services of the object must be focused on loading this single responsibility (SRP).

• If you put more than one functionality in a class in Java, introduce the coupling between two characteristics and, although it changes functionality, there is a possibility that it has broken the coupled functionality, which requires another round of testing to avoid any surprise. production environment.

Liskov's Substitution Principle (LSP)


• A subclass must be adequate for its base classes.

• According to the Liskov substitution principle, the subtypes must be replaceable by supertype, that is, methods or functions, which use a type of superclass to be able to work with the object of a subclass without any problem.

• PSL is intimately related to the principle of single responsibility and the principle of interface segregation. If a class has more functionality than a subclass, it may not support some of the features and violate the LSP.

Interested in learning Java? Join now:” java training in bangalore “

Interface Segregation Principle (ISP)


• Statistics of the Principle of Interface Segregation that, a client should not implement an interface if he does not use it.

This occurs mainly when an interface contains more than one functionality, and the client only needs one functionality and not the other. The design of the interface is complicated, because after releasing its interface, you will not be able to change it without breaking the entire implementation.

• Another benefit of this design principle in Java is that an interface has the disadvantage of implementing the entire method before any class can use it, so having a single functionality means less method to implement.

Dependency Injection or Inversion Principle


• Do not ask for a dependency - a structure will be provided. This was very well implemented in the framework of Spring. The beauty of this design principle is that any class that is injected by the DI structure is easy to test with the mock object and easier to maintain because the object creation code focuses on the structure and the client code is not full of it.

• There are several ways to implement a dependency injection, such as the use of bytecode instrumentation, which some AOP (Aspect Oriented Programming) frameworks, like AspectJ, do, or use proxies, as well as those used in the Spring. See this example of the IOC and the DI design standard to learn more about this SOLID design principle






From Java 8 to Java 11

Switching from Java 8 to Java 11 is more complicated than most updates. Here are some of my notes on the process. Modules Java 9 i...