In this story I will go through the concept of Distribution Patterns, Data Transfer Object and Remote Facade.

Image for post
Image for post

Data Transfer Object

I’m pretty sure you already heard about DTO (also called value objects) and created at least one DTO class in your software dev career.

When you’re working with a remote interface (e.g., web services), each call to it is expensive. As a result you need to reduce the number of calls, and that means that you should use DTO that aggregates the data to transfer more data with each call.

Data Transfer Object should not contain any business logic and it needs to be serializable to go across the connection. Usually an assembler also called mapper is used for data transfer between domain objects and DTO objects. …

Image for post
Image for post

In this story we are going to see what is memory leak, garbage collector, examples of leaks in Java and tools to detect leaks.

One of the key benefits of Java is that memory management is mainly handled by Java Virtual Machine or more specific Java Garbage Collector (GC). Java Garbage Collector is responsible for allocation and deallocation of objects on Heap.

What is Memory Leak

In computer science, memory leak means that computer programs incorrectly manage memory allocation by not releasing resources that are not needed. In Java, Memory Leak occurs when an object is no longer being used by an application, but Garbage Collector is not able to remove it from working memory (Heap). …

Image for post
Image for post

In this post we are going to see examples of thread joining, thread synchronization using object’s wait, notify and notifyAll methods and what is ThreadLocal and how to use it.

If you are more interested in Race Condition and Deadlock situations, take a look at my previous post (Threads in Java).

Thread Joining, join() method

The join() method puts the calling thread into a waiting state until the referenced thread terminates. It means that the join() method makes one thread wait until another thread completes its execution. If any thread calls an interrupt of the referenced thread, InterruptException exception will be thrown.

Method signatures

Waits forever for the thread to die. …


Milan Adamovic

Senior Software Engineer. LinkedIn profile:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store