DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Latest Articles - DZone

article thumbnail
Develop a Java Application With Kafka
In this article, we discuss how to develop a secure, scalable, messaging Java application with Kafka
Updated March 11, 2020
by Daniel Pereira
· 59,832 Views · 11 Likes
article thumbnail
Develop a Secure CRUD Application Using Angular and Spring Boot
In this article, we discuss how to implement OpenID Connect with Angular, Kotlin, Spring Boot, and Okta.
Updated March 11, 2020
by Matt Raible
· 20,375 Views · 6 Likes
article thumbnail
Develop a REST API Using Java and Jetty
In this tutorial, you will build a simple web service with Jetty embedded. After that, you will build the same web service in Spring Boot and Jetty.
Updated March 11, 2020
by Andrew Hughes
· 55,512 Views · 9 Likes
article thumbnail
Immutability in JavaScript — When and Why Should You Use It
In this article, take a look at immutability in JavaScript and see when and why you should use it.
March 10, 2020
by Manjunath M
· 39,075 Views · 3 Likes
article thumbnail
Skaffold: K8s Development Made Easy
In this post, look at Skaffold for automatic building and deploying our application to a Kubernetes cluster during development.
March 10, 2020
by Gunter Rotsaert DZone Core CORE
· 14,499 Views · 8 Likes
article thumbnail
Loading Files From Web Browser With Mule
This tutorial explains how to load files from your web browser using Mule 4.
Updated March 10, 2020
by Kasim Bekur
· 18,089 Views · 4 Likes
article thumbnail
Collecting Logs in Azure Databricks
This article demonstrates how you can use Azure Databricks with Spark to create and collect logs and Docker.
March 10, 2020
by Shubham Dangare
· 9,460 Views · 1 Like
article thumbnail
The Anatomy of a Microservice, One Service, Multiple Servers
It’s (finally) time to look at the API Server layer and expose the business service to the outside world.
March 10, 2020
by Ray Elenteny DZone Core CORE
· 17,209 Views · 5 Likes
article thumbnail
How to Enable HTTPS on a Spring Boot Application
In this article, see a tutorial on how to enable HTTPS on a Spring Boot application.
March 9, 2020
by EBINEZAR GNANASEKARAN
· 82,794 Views · 22 Likes
article thumbnail
Deploying an Angular App to AWS S3
In this article, you'll create and deploy an Angular app to AWS S3 from scratch in less than five minutes Prerequisites
March 9, 2020
by Marouen Helali
· 31,508 Views · 6 Likes
article thumbnail
Defining Implementations of Services: Dependency Injection in Angular
I was working on a practical project using Angular 8, where I was creating a service and thinking more about how to implement SOLID principles. I decided to have an interface to define my service and a class to implement the logic. Everything was okay with that design, but a question came to my mind, "How can I implement dependency injection with my Angular component?" In this example, I am going to use an abstract class, Let's create an abstract class, named IGreetingsService. This will be used as an Interface with a greeting method. TypeScript x 1 export abstract class IGreetingsService { 2 constructor() { } 3 abstract greeting(): String; 4 } Now, let's create a class, GreetingsServiceImpl. This class implements the IGreetingsService abstract class. TypeScript xxxxxxxxxx 1 1 export class GreetingsServiceImpl implements IGreetingsService { 2 constructor() { } 3 greeting(): String{ 4 return "Pruebaa"; 5 }; 6 } At this point, we have a regular class to use as a service, but we need to add the annotation @Injectable. We have to put it at IGreetingsService. TypeScript x 10 1 @Injectable({ 2 providedIn: 'root', 3 useClass: GreetingsServiceImpl, 4 }) 5 export abstract class IGreetingsService { 6 7 constructor() { } 8 9 abstract greeting(): String; 10 } The magic is at the property useClass. This class is used by the Angular framework to know what concrete class has to use for dependency injection when you are using theIGreetingsService abstract class. So we are ready to use our service into an angular component. TypeScript xxxxxxxxxx 1 12 1 @Component({ 2 selector: 'my-app', 3 templateUrl: './app.component.html', 4 styleUrls: [ './app.component.css' ] 5 }) 6 export class AppComponent { 7 name: String; 8 constructor(private service: IGreetingsService ) { 9 this.name = this.service.greeting(); 10 } 11 12 } At the moment, to create an instance of the AppComponent, Angular automatically creates an instance of GreetingsServiceImpl , instead of IGreetingsService. (Remember IGreetingsService is an abstract class). This approach can help you in several situations; for example, think about a service using REST services to get some data, but now there is a new requirement, and you need to get the same data from session storage or local storage. You can create a new class implementing your abstract class and update the property useClass to refer to your new class. Another situation would be if you needed a different implementation on production environments and testing environments. You can find the complete source code here: https://stackblitz.com/edit/angular8-injectiondependency-interface. A final note, you can define a provider in the component definition annotation to inject a specific implementation of your service. TypeScript x 1 @Component({ 2 selector: 'my-app', 3 templateUrl: './app.component.html', 4 styleUrls: [ './app.component.css' ], 5 providers :[{ provide: IGreetingsService, useClass: GreetingsServiceImpl }] 6 }) Further Reading Angular: Everything You Need to Know [Tutorials]. About Dependency Injection.
March 9, 2020
by Javier Santos
· 9,492 Views · 4 Likes
article thumbnail
Unbounded Stream Processing Using Apache Beam
Today, we are going to build a simple WordCount data pipeline using Apache Kafka for unbounded sources.
March 9, 2020
by Sunil pandith
· 16,290 Views · 3 Likes
article thumbnail
Compile Protocol Buffers Using Maven
This tutorial explains how to compile protocol buffers using Maven.
March 6, 2020
by Munander Singh
· 66,094 Views · 5 Likes
article thumbnail
How to Test for Lock Table Consistency When Deploying High Availability for SAP ERP
In this article, see how to test for lock table consistency and create shared file systems when deploying high availability for SAP ERP.
March 6, 2020
by Harry Aujla
· 13,834 Views · 3 Likes
article thumbnail
Integration Dotenv With NestJS and Type ORM
In this article, we discuss how to integrate dotenv with NestJs and TypeORM to get you up and going with your Node application configuration.
March 5, 2020
by Jason Rees
· 24,791 Views · 5 Likes
article thumbnail
Taming AWS Costs With Cost and Usage Reports + AWS Athena
If your cloud costs are wearing you down, take a look at how you can integrate AWS Athena with you database for better cost usage insight.
Updated March 5, 2020
by Ayush Sharma
· 6,944 Views · 2 Likes
article thumbnail
Spring Security — Chapter 1
In this article, see how to get started using Spring Security to manage authentication and authorization in a Java application.
March 5, 2020
by Vinu Sagar
· 17,638 Views · 20 Likes
article thumbnail
Top 7 Programming Languages for Test Automation in 2020
In this article, look at a highlight of the top 7 programming languages to look out for for test automation in 2020.
March 5, 2020
by Himanshu Sheth DZone Core CORE
· 24,802 Views · 15 Likes
article thumbnail
13 Effective Ways for Scrum Masters to Build Happy Teams
In this article, we discuss thirteen effective ways for Scrum master to build happier and more effective teams.
March 5, 2020
by Shrivallabh Bharatiya
· 13,157 Views · 7 Likes
article thumbnail
Purpose and Role of DevOps in Custom Software Development
In this article, learn more about the purpose and role of DevOps in custom software development.
March 4, 2020
by Sourabh Nagar
· 14,484 Views · 6 Likes
  • Previous
  • ...
  • 970
  • 971
  • 972
  • 973
  • 974
  • 975
  • 976
  • 977
  • 978
  • 979
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×