Over a million developers have joined DZone.

The Codeless Code: Case 3 - Encapsulation

DZone's Guide to

The Codeless Code: Case 3 - Encapsulation

· Java Zone ·
Free Resource

Take 60 minutes to understand the Power of the Actor Model with "Designing Reactive Systems: The Role Of Actors In Distributed Architecture". Brought to you in partnership with Lightbend.

A young monk, new to the temple, not only declared all his methods public but all his instance variables as well. The head abbot grew weary of rebuking the monk and asked the Java master for advice.

The next day, the master summoned the monk to take lunch with him in his private office.

The monk entered to find a sumptuous meal laid out upon the conference table. The master then bade the monk to lie upon the floor.

The monk did as commanded, whereupon the master opened the monk’s robes and drew a large knife. He pressed the naked point firmly into the monk’s chest until a ruby droplet welled up around the blade. The monk cried out in terror and asked the master what his intention was.

“To slit open your belly,” explained the master, “so that I may spoon the rice and pour the tea inside. My schedule is quite full, and I find this method of feeding guests to be extremely efficient.”

Afterward the monk required no more correction.

Learn how the Actor model provides a simple but powerful way to design and implement reactive applications that can distribute work across clusters of cores and servers. Brought to you in partnership with Lightbend.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}