Wednesday, January 23, 2019

Updates in Java Spring Framework 5.0


Updates in Java Spring Framework 5.0

Spring Framework 5.0 was launched with some new enhancements and features. At the top level, these new features can be categorized  as:

  • Core framework revision.
  • Core container updates
  • JDK baseline update
  • Functional programming with Kotlin
  • Reactive Programming Model
  • Testing improvements
  • Library support


Core Framework Revision

The core Spring Framework 5.0 has been revamped to be able to use the new features of Java 8. The key revisions are:
  • The method parameters of Spring Framework 5.0 can efficiently access the reflection enhancements of Java 8.
  • The interfaces of Core Spring have be revised to provide selective declarations, which are build on Java 8 default methods.
  • @NotNull and @Nullable will clearly mark nullable return values and arguments.
  • Spring Framework 5.0 also comes with a Commons Logging Bridge Module, known as spring-jcl.
  • Defensive programming also gets an upgrade with Resource Abstraction, where the isFile indicator is for getFile method.


Core Container Updates

The framework has a new update called candidate component index. It is like an alternative option to classpath scanning process. It is particularly helpful where there are more than 200 classes. Candidate component index shortens the candidate component identification step.

The build task of any application can state its own spring. components file / META-INF. On compilation the Spring components and JPA entries are flagged.

Indicators at optional injection points can now be done with @Nullable annotations, previously it could be  done only through JSR 305's Nullable, Checker Framework's Nullable and Android's Nullable.

JDK Baseline Update

The codebase of Spring Framework 5.0 required Java 8 as minimum requirement. This allows the developers to use all the latest Java updates.

Functional programming with Kotlin

Kotlin is an oject oriented programming language, with Spring Framework 5.0 supporting this language, developers can it for bean registration and functional Web endpoints.
In Spring Framework 5.0,  using Kotlin code a Web functional API can be written like this :

{

("/movie" and accept(TEXT_HTML)).nest {

GET("/", movieHandler::findAllView)

GET("/{card}", movieHandler::findOneView)

}

("/api/movie" and accept(APPLICATION_JSON)).nest {

GET("/", movieApiHandler::findAll)

GET("/{id}", movieApiHandler::findOne)

}

}

Reactive Programming Model

Spring comes with a reactive stack Web framework. This framework is highly suitable for event-loop style processing as it is non-blocking and fully reactive.

Reactive streams is a kind of  API specification, developed by engineers from Pivotal, Netflix, Typesafe, Oracle, Ret Hat, Spray.io and Twitter. In Spring the streaming support is designed on a Project Reactor, which in turn runs the Reactive Streams API specifications.

Testing improvements

It supports JUnit 5 Jupiter for writing tests and extensions in JUnit 5 and also provides a test engine for running Jupiter-based test. In Spring TestContext Framework, it supports parallel tests execution. WebTestClient is also available for reactive programming model.

Library Support

The following upgraded library versions are supported by Spring Framework 5.0:

  • Jackson 2.6+
  • EhCache 2.10+ / 3.0 GA
  • Hibernate 5.0+
  • JDBC 4.0+
  • XmlUnit 2.x+
  • OkHttp 3.x+
  • Netty 4.1+


Undoubtedly reactive programming is the highlight of Spring Framework 5.0. Its features have been added to Spring Security, Spring Data and Spring Integration.

Amazon Web Services


Amazon Web Services

Launched in 2006, Amazon Web Services is a pioneer cloud solution provider. It is a subsidiary company of Amazon.com and is perhaps is one of the biggest player in the cloud computing market. It is providing on-demand cloud computing platform to governments, companies and individuals on paid subscriptions.
A cloud platform like Amazon Web Service allow its users to access servers, databases, application services and storage over the internet. It  allows requisitioning of computing power, storage and many other services within minutes, with no hidden or up-front expenses. The services work on pay for you use basis.
Since its launch AWS has grown rapidly catering to thousands of clients in over 190 countries. Many well-known organizations, like Zoopla, Hailo, Shell, Shop Direct, Unilever and many more use AWS services.

Amazon Web Services
Some of the widely used AWS are:

Amazon Elastic Computer Cloud (EC2) : It is designed to ensure smooth web-scale computing for  system administrators and developers. It provides them with tools to design and build the best failure resistant applications.

Amazon Simple Storage Service (Amazon S3) : Amazon S3 is internet storage. It provides very simple web service interface for storing and retrieving any amount of data, anytime, from anywhere.

Amazon CloudFront : This is primarily web content delivery service. It is optimized to work seamlessly with all other Amazon Web services to give businesses an efficient and easy way to distribute their content with high speed data transfers and low latency.

Amazon Relational Database Service (Amazon RDS) : It gives freedom from traditional time-consuming database administration by providing this web service, which is easy to set up and operate a relational database in the cloud. The capabilities and tools of popular database services like Oracle, MySQL or SQL Server can be used with Amazon Relational Database Service.

Amazon Elastic MapReduce (Amazon EMR) :  This is another web service, which is quick, efficient and cost-effective in processing large amounts of data.

Amazon Simple Notification Service (Amazon SNS) : SNS is a push messaging service. It is quick, flexible, simple and cost-effective in sending push messages to mobile devices such as iPad, iPhone, Kindle Fire and internet connected mobile devices. SNS can also send notifications through email or SMS.

Amazon Simple Queue Service (Amazon SQS) : SQS is designed to transfer any volume of data, at any level without losing any information. It is fast and reliable message queuing service.

Amazon Virtual Private Cloud (Amazon VPC) : Using AWS resources, Amazon VPC allows the user to create a personal virtual network. The user can have complete control over this virtual network.

AWS Identity and Access Management (IAM) :  IAM empowers the user / administrator to control the access of AWS resources and services. Using IAM, user can efficiently manage AWS users, create and manage groups, grant or deny permissions to access AWS resources.

Businesses across the globe are using Amazon Web Services for almost everything from running websites to running and maintaining their technology infrastructure. AWS is also being used by many educational institutes, public sector departments and non-profit  organizations for its benefits and efficiency. For example, in UK - Amazon Web Services work very closely with Cancer Research UK and research projects like Genes in Space.