Over a million developers have joined DZone.

The Static Spider Web Pattern

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

While the developer lexicon is loaded up with more patterns than we can possibly ever learn, I just wanted to introduce one of the more important patterns that I think exists out there in software development. I call it the “Static Spider Web” pattern. The main driver behind this pattern is that object instantiation, allocation, and deallocation impose far too much overhead in modern programming language runtimes. Since we aren't in direct control of memory management, and since garbage collectors on systems with large amounts of memory can cause huge latency overheads, we need to find some way to minimize, at all costs, the number of objects that we allocate.

"I'm picking up your sarcasm." "Well, I should hope so, because I’m laying it on pretty thick." –Tommy Boy

First, we are going to have to just accept the fact that we will have to create a few objects. I mean, our application data needs to go somewhere, right? I'd advocate for passing the data around as parameters, but that would get old pretty quick with all of that typing. Besides, that is what objects were invented for, to be stateless data containers.

Read the rest of this post at http://www.codethinked.com

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}