Monthly Archives: August 2017

Angular 4.2

The Angular team continues to publish new versions of Angular according to the Semantic versioning. Angular version 4 was released on March 16, six months’ later version 2 was released. In the last three months two minor versions and a lot of patch versions were born with new stuff. Angular 4.2 is already here and we have a huge number of new features added for making animations easier and powerful. Part of them are defining the reusable animations, querying for inner elements, animating when routes change and building/controlling an animation using AnimationBuilder. So, let’s dive deep-in and know about the new features in Angular 4.2.

WHAT’S NEW?

Angular Forms now includes validators for min and max attributes.

Developer can now bootstrap a component directly by passing an element reference to the bootstrap method of an ApplicationRef.

New compiler flag alwaysCompileGeneratedCode is available in opt-in, and will be turned on by default in the future.

NEW FEATURES IN ANGULAR 4.2Forms

Two new validators joins the existing requirement, minLength, maxLength, email, and pattern. Min and Max helps the developer to validate whether the input is at least or at most the value specified or not.

<input type=”number” [(ngModel)]=”user.age” min=”0″ max=”130″>

Update (2017-06-17): The min and max validators have been temporarily removed from Angular in version 4.2.3, as they are a breaking change. They’ll return in a major version, maybe 5.0.0.

Angular Animations

There are huge number of new features to make working with Animations easier and more powerful. Some of the new feature are:

Configure options and set input variables within animations.

Define reusable animations using animation().

Stagger multiple elements within an animation using stagger().

Enable queried elements to trigger their own animations.

Orchestrate a full-blown animation when routes change.

Programmatically build/control an animation using AnimationBuilder

A new query function has been introduced in the animation DSL, allowing to query the elements in the template. It uses querySelectorAll behind the scene, so the developer can use an element or a class as parameter. It also supports pseudo-selectors, and that opens a few interesting possibilities!

Now, every time an element is removed from the races array, it will slowly fade out. And when an element enters, it will slowly fade’s in.

Animation has also been added to build reusable animations. The syntax allows to have dynamic parameters with default values. The developer need to use a reusable animation, they can call useAnimation, and override the default parameters if they want to.

FINAL WORD

That’s all for this release! The focus was mainly on animations and tests, and the team is also working on reducing the bundle size of the applications, with the help of the Google Closure Compiler. We think we are going to learn more about that very soon!

SpringBoot

Spring is a very popular Java based framework for building web and enterprise applications. Unlike many other frameworks which focuses on only one area, Spring framework provides a wide variety of features addressing the modern business needs through its portfolio projects. Spring framework provides flexibility to configure the beans in multiple ways such as XML, Annotations, and JavaConfig. With the number of features increased the complexity also gets increases and configuring Spring applications becomes tedious and error-prone. Spring team created SpringBoot to address the complexity of configuration. Explore this article and know more about SpringBoot.

Overview of Spring framework

If you are a Java developer, then there is a high chance that you might have heard about Spring framework and probably have used it in your projects. Spring framework was initially created as a Dependency Injection container but we all know it is much more than that.

Spring Social : Supports integration with social networking sites such as Facebook, Twitter, LinkedIn, GitHub, and much more.

Spring Integration : An implementation of Enterprise Integration Patterns to facilitate integration with other enterprise applications using lightweight messaging and declarative adapters.

There are many other interesting projects addressing various other modern application development needs.

In the initial days, Spring framework has provided XML based approach for configuring beans. Later Spring has introduced XML based DSLs, Annotations, and JavaConfig based approaches for configuring beans.

A quick taste of SpringBoot

Welcome to SpringBoot! SpringBoot do what exactly you are looking for. It will do things automatically for the user and allows them to override the defaults if they want to.

Service Oriented Architecture

Service-oriented architecture (SOA) is an evolution of distributed computing based on the request or reply design paradigm for synchronous and asynchronous applications. An application’s business logic or individual functions are modularized and presented as services for consumer or client applications. The key to these services is their loosely coupled nature; i.e., the service interface is independent of the implementation. Application developers or system integrators can build applications by composing one or more services without knowing the services’ underlying implementations. For instance, a service can be implemented either in .Net or J2EE, and the application consuming the service can be on a different platform or language. Explore this article and get an in-depth idea about SOA.

Key characteristics of SOA

SOA services have self-describing interfaces in platform-independent XML documents. Web Services Description Language (WSDL) is used to describe the services.

SOA services connects with the messages formally which is defined through XML Schema. Communication among the consumers and providers or services typically happens in heterogeneous environments, with less or no knowledge about the provider. Messages between the services can be viewed as key business documents processed in an enterprise.
SOA services are maintained in the enterprise by a registry that acts as a directory listing. Applications can look up the services in the registry and can invoke the service.

Architecture

Several service consumers can invoke services by sending the messages. These messages are transformed and routed by a service bus to an appropriate service implementation. The service architecture also provides a service management infrastructure that manages the services and activities such as, auditing, billing, and logging. In addition, the architecture also offers enterprises the flexibility of having agile business processes, better addresses the regulatory requirements like Sarbanes Oxley (SOX), and changes individual services without affecting other services.

Why SOA?

The reality in IT enterprises is that infrastructure is heterogeneous across the operating systems, applications, and system software. Some existing applications are used to run current business processes, so starting from the scratch to build new infrastructure isn’t an option. Enterprises should quickly respond to the business alterations with agility and should leverage the existing investments in applications and application infrastructure to address the new business requirements. SOA with its loosely coupled nature allows the enterprises to plug in new services or upgrade existing services in a granular fashion to address the new business requirements, provides the option to make the services consumable across different channels, and exposes the existing enterprise and legacy applications as services, thereby protecting existing IT infrastructure investments.

The Benefits of SOA

While the SOA concept is fundamentally not new, SOA differs from existing distributed technologies. SOA, with a ubiquitous set of standards, brings better reusability of existing assets or investments in the enterprise and lets the user to create applications that can be built on top of new and existing applications. SOA enables the changes to applications while keeping clients or service consumers isolated from evolutionary changes that happen in the service implementation. SOA enables upgrading individual services or services consumers; it is not necessary to completely rewrite an application or keep an existing system that no longer addresses the new business requirements. Lastly, SOA also provides enterprises better flexibility in building applications and business processes in an agile manner by leveraging existing application infrastructure to compose new services.

What is a RESTful API?

With all the hype surrounding RESTful web services, you’d think it was suddenly a new concept that shot forth on the scene only a year or two ago. The truth is, the concepts underlying RESTful APIs are as old as the web and are best understood from that perspective. Explore this article and know more about RESTful API and how it works.

RESTful API

REST technology is usually preferred as more robust Simple Object Access Protocol (SOAP) technology because REST leverages less bandwidth, making it more suitable for the internet usage. An API for a website is the code that allows two software programs to communicate with each other. The API spells out the proper way for a developer to write a program requesting all the services from an operating system or other application.

The REST is used by browsers can be thought as the language of the internet. As cloud usage is on the rise, APIs are emerging to expose web services. REST is a logical choice for building APIs that allows the users to connect and interact with cloud services. RESTful APIs are used by the sites such as Amazon, Google, LinkedIn, and Twitter.

How RESTful APIs works

A RESTful API breaks down a transaction to create a series of small modules. Each module addresses a particular underlying part of the transaction. This modularity provides developers with a lot of flexibility, but it can also be challenging for developers to design from scratch. Presently, the models provided by Amazon Simple Storage Service, Cloud Data Management Interface, and OpenStack Swift are the most popular.

A RESTful API explicitly takes advantage of HTTP methodologies defined by the RFC 2616 protocol. They use GET to retrieve a resource, PUT to change the state or to update a resource, which can be an object, file or a block, POST to create the resource, and DELETE to remove it.

With REST, networked components are a resource you request to access a black box whose implementation details are unclear. The presumption is that all calls are stateless; nothing can be retained by the RESTful service between executions.

As, the calls are stateless, REST is useful in cloud applications. Stateless components can be freely redeployed if something fails, and they can scale to accommodate load changes. This is because any request can be directed to any instance of component. That makes REST preferred for web use, but the RESTful model is also helpful in cloud services because binding to a service through an API is a matter of controlling how the URL is decoded. Cloud computing and micro services are almost certain to make RESTful API design the rule in the future.

Single Sign-On (SSO)

Single-sign-on (SSO) authentication at present is required more than ever. Nowadays, almost every website requires some form of authentication to access its features and content. With the number of websites and services increasing, a centralized login system has become a necessity. In this article we’ll let you know what is SSO and how SSO authentication works.

What is SSO

Single Sign On (SSO) occurs when a user logs in to one Client’s system and then signed in to other Clients system automatically, regardless of the platform, technology, or domain the user is using.

Google’s implementation of login for their products, such as Gmail, YouTube, Google Analytics, and much more, is one of the best examples of SSO. Any user who are logged-on to one of Google’s products are automatically logged in to their other products as well.

Single Sign On usually makes use of a Central Service which organizes the single sign on between multiple clients. In the example of Google, this central service is Google Accounts. When a user first logs-in, Google Accounts creates a cookie, which persists with the user as they navigate to other Google-owned services. The process flow is as follows:

The user accesses the first Google product.

The user receives a generated cookie.

The user navigates to another Google product.

The user is redirected again to their accounts.

Google Accounts sees that the user already has an authentication-related cookie, so it redirects the user to the requested product.

How it works

In a basic web SSO service, an agent module on the application server retrieves the specific authentication credentials for an individual user from a dedicated SSO policy server, while authenticating the user against a user repository such as a lightweight directory access protocol (LDAP) directory.

Some of the SSO services uses protocols such as Kerberos and the security assertion mark-up language (SAML). SAML is an XML standard that facilitates the exchange of user authentication and authorization data across secure domains. SAML-based SSO services involves the communications between the user, an identity provider that maintains a user directory, and a service provider. When a user attempts to access an application from the service provider, the service provider will send a request to the identity provider for authentication. The service provider will then verify the authentication and log the user in. The user will not have to log in again for the rest of his session. In a Kerberos-based setup, once the user credentials are provided, a ticket-granting-ticket (TGT) is issued. The TGT fetches service tickets for other applications the user wishes to access, without asking the user to re-enter the credentials.

Although single sign-on is a convenience to users, it presents risks to the enterprise security. An attacker who gains control over a user’s SSO credentials will be granted access to every application the user has rights, increasing the amount of potential damage. In order to avoid malicious access, it is essential that every aspect of SSO implementation be coupled with identity governance. Organizations can also use two factor authentication (2FA) or multifactor authentication (MFA) with SSO to improve the security.

Conclusion

SSO authentication is here, decentralized systems are becoming more and more common and authentication is an essential aspect of all of them. SSO solves a big problem such as how to manage the increasing number of users across a whole ecosystem of applications and services. If you are implementing authentication for a new application or a service, consider integrating SSO from the get-go.

What Is Python? What are the benefits of using Python? What do you understand of PEP 8?

Python is one of the most successful interpreted language. When you write a Python script, it doesn’t need to get compiled before execution. Few other interpreted languages are PHP and Javascript.

Benefits Of Python Programming:

Python is a dynamic-typed language, this means that you don’t need to mention the date type of variables during their declaration. It allows to set variables like var1=101 and var2 =” You are an engineer.” without any error.

Python supports object orientated programming as you can define classes along with the composition and inheritance. It doesn’t use access specifiers like public or private.

Functions in Python are like first-class objects. It suggests you to assign them to variables, return from other methods, and pass as arguments.

Developing using Python is quick but running it often is slower than compiled languages. Luckily, Python enables to include the “C” language extensions so that you can optimize your scripts.

Python has several usages like web-based applications, test automation, data modeling, big data analytics, and much more. Alternatively, you can utilize it as “glue” layer to work with other languages.

PEP 8:

PEP 8 is the latest Python coding standard, a set of coding recommendations. It guides you to deliver more readable Python code.