One of the more difficult tasks when you're writing applications is partitioning an application to increase performance or scalability. The partitioning of the program is simple, but it's not simple to make the partitioning work effectively. It is difficult to make the program work because it is hard to write the infrastructure classes necessary to effectively partition an application. Often, the programmer does not have enough time to consider all of the ramifications . Hence, a partitioning of the application could result in slower execution times.
Effective partitioning requires two major algorithm techniques: multi-threading and pooling of objects. A third algorithm techniquecreating immutable objectsis more of a best practice. The task in this chapter is to show how to use the infrastructure code that will make an application easier to scale.