Editorials

Immutable Objects

$$SWYNK$$

Immutable Objects
Immutable objects are a technique in object oriented programming where the properties of an object are read only. If they need to be changed, this is done through the creation of a new object of the same type, having the desired changes. Perhaps some of the original values are retained and only a few are modified. Perhaps all properties are modified. Regardless, the only way to change properties is to create a new object.

Doesn’t this create overhead and take more time than simply making the properties of the original value read/write capable? Yes, it does slow things down and may place more work on destruction and recovery of memory for engines such as Java or .net.

So, why use Immutable Objects? The key reason is performance. Although immutable objects may perform more slowly in a single threaded application, immutable objects can vastly outperform in multi-threaded enviroments refrencing the same objects.

Some OO purists would say you should only use Immutable objects. Have you found Immutable objects to be effective? Does it make sense to use Immutable Objects in web application code? Are they just a bunch of overhead? Share your experience by writing btaylor@sswug.org.

Cheers,

Ben

SSWUGtv – Deployment Projects
With Stephen Wynkoop
What is the process of a typical deployment project, and how do you make it successful? Today Steve interviews Patrick Townsend sharing some great ideas.
Watch the Show

Featured Article(s)
Questions to Ask Before You Exit a Job Interview
We all understand the importance of preparing for an interview: doing our homework on the company, clearly articulate what we can bring to that position, and projecting good body language throughout. But what are some of the things we need to remember as we are walking out of that interview?

Featured White Paper(s)
Key Management in the Multi-Platform Environment
Written by Townsend Security

This White Paper discusses the challenges … (read more)