VOOZH about

URL: https://dzone.com/users/3064135/husseinterek.html

⇱ Hussein Terek - DZone Member


Hussein Terek

Joined Jul 2017

https://www.programmergate.com/

About

Senior software engineer with 5 years of experience in software design, development and integration. Author of www.programmergate.com blog which provides essential articles and tutorials about software engineering and java technology. ' Twitter: @houssein_terek

Stats

Reputation: 929
Pageviews: 2.0M
Articles: 11
Comments: 14

Articles

How to Convert List to Map in Java
Want to learn how to convert list to map in Java? Click here to learn how to do this in both Java 7 and Java 8.
Updated July 23, 2018
· 131,063 Views · 26 Likes
Spring Boot: Solving OAuth2 REDIRECT_URI_MISMATCH [Snippet]
If you've come across a redirect_uri_mismatch error before when using Spring Boot and OAuth 2, then this solution is for you.
May 31, 2018
· 30,558 Views · 3 Likes
Spring Boot: Solving OAuth2 ERR_TOO_MANY_REDIRECTS [Snippet]
We take a look at how to solve an issue you may come up against when integrating OAuth 2 with your Spring Boot project.
May 30, 2018
· 43,647 Views · 4 Likes
Spring Boot + JPA + Hibernate + Oracle
This tutorial will walk you through the steps needed to combine the power of Spring Boot, Hibernate, and Oracle.
April 14, 2018
· 465,623 Views · 29 Likes
Changing the Default Port of Spring Boot Apps [Snippets]
Let's take a look at three different approaches you can take to defining your Spring Boot app's default Tomcat port, as well as the impacts of those approaches.
March 19, 2018
· 187,102 Views · 14 Likes
Introducing Spring Boot
We go over a quick conceptual introduction to Spring Boot before moving on and developing a REST API using this Java-based framework.
March 13, 2018
· 65,656 Views · 38 Likes
Using Enums in Java [Snippets]
This quick primer on enums in Java will go through some typical use cases and operations using snippets of enums in action.
March 7, 2018
· 34,744 Views · 7 Likes
Working With hashcode() and equals()
Need to implement your own custom equality-checking mechanism? Here are some tips for when you need to override hashcode() and equals().
Updated January 2, 2018
· 380,892 Views · 56 Likes
How to Create an Immutable Class in Java
Here, we'll define the typical steps for creating an immutable class in Java and shed light on some common mistakes made while creating immutable classes.
December 12, 2017
· 255,536 Views · 126 Likes
Build a REST Web Service Using Spring
This tutorial provides a step-by-step guide for building and configuring a REST web service in Java using the Spring framework.
December 2, 2017
· 275,377 Views · 25 Likes
Java: What to Know About Passing by Value
Of course, in Java, arguments are always passed by value. Let's see what that means inside and the heap with primitives, collections, and making modifications.
Updated November 22, 2017
· 64,134 Views · 50 Likes

Comments

Introducing Spring Boot

Mar 23, 2018 · Hussein Terek

Check this http://programmergate.com/category/spring-boot/

How to Create an Immutable Class in Java

Dec 14, 2017 · Hussein Terek

If you return a clone instance from getAge(), then the caller will be accessing a completely separate instance of Age.

Hence the age of Alex will not be affected.

How to Create an Immutable Class in Java

Dec 14, 2017 · Hussein Terek

Seems to be interesting, would definitely check it.

How to Create an Immutable Class in Java

Dec 14, 2017 · Hussein Terek

Immutable classes are beneficial in any environment as you stated.

Most developers tend to relate immutability directly to multi-threaded environments because they can clearly see its advantages.

However, i consider it as one of the common design principles which should be achieved in any long-live software application.

How to Create an Immutable Class in Java

Dec 13, 2017 · Hussein Terek

Exactly, the main benefit of immutable classes is in multithreaded environments, where it's very costly to protect object state from concurrent modifications.

How to Create an Immutable Class in Java

Dec 13, 2017 · Hussein Terek

Agree with you

Java: What to Know About Passing by Value

Nov 24, 2017 · Hussein Terek

myInt is a field, it represents the object state and always stored in the heap as i mentioned in the article.

Variables are different from fields, they are normally defined inside methods and store some data. Like when you say:

public void test(){

int myInt = 2;

}

Java: What to Know About Passing by Value

Nov 24, 2017 · Hussein Terek

I didn't say it's different , you can pass static variables as method arguments noone can prevent you.

i am talking from best practices perspective, just wondering what's the point of passing it as method arguments if you already able to access it inside method scope. It's like passing an object and its fields together in method arguments. Hope you got my point

Java: What to Know About Passing by Value

Nov 24, 2017 · Hussein Terek

Can you explain more please ?

Java: What to Know About Passing by Value

Nov 24, 2017 · Hussein Terek

There is no specific handling for static variables when passed as method arguments, they are treated the same as normal variables.

my idea is why do you pass a PUBLIC static variable as method parameter if you're able to access it anyway through the class name, as if you pass an object along with its state in a method arguments this is nonsense too.

Java: What to Know About Passing by Value

Nov 24, 2017 · Hussein Terek

Good explanation, I agree.

Java Hashcode and Equals Deep Dive

Sep 23, 2017 · Marcus Biel

Thanks Marcus.

I like how you explain "why overriding hashcode() alone doesn't force java to ignore memory addresses when comparing 2 objects". Good catch.

I'll definitely update my article to clarify this point.

Regarding my comment, I'm sorry if it looked bad to you, i just wanted to share my opinion and ask for your feedback.

I have no problem if you just delete it.

Java Hashcode and Equals Deep Dive

Sep 22, 2017 · Marcus Biel

If 2 objects are equal, they must have the same hash code.

If 2 objects have the same hash code, it doesn't mean that they are equal.

Overriding equals() alone will make your business fail when working with hashing data structures like: HashSet, HashMap, HashTable. ...

Overriding hashcode() alone doesn't force java to ignore memory addresses when comparing 2 objects.

Check this tutorial.

RESTful Web Service With Example

Jul 27, 2017 · Arun Pandey

Check this article to learn the most efficient way of structuring your web service application so that it's maintainable and open for future changes.

http://programmergate.com/web-service-project-structure/

User has been successfully modified

Failed to modify user

Let's be friends: