title: OOP and Scalability
body: <p>I was reading an article on ibm.com/developerworks (can't find the article now) about developing scalable software for the cloud.</p>
  
  <p>Of course the main idea was going stateless. Nothing should contain state anymore and this was done by not having member data anymore. Every method should get its date by arguments passed to it.</p>
  
  <p>One example was something like:</p>
  
  <pre><code>class NonScalableCircle {
      int radius;
  
      void setRadius(int radius){
          this.radius = radius;
      }
  
      public integer getDiameter() {
          return 2*radius;
      }
  }
  </code></pre>
  
  <p>The explanation why this was not scalable was because you have to set the radius first and then call the diameter. So there is an order to it in order to work because methods work on the same data.</p>
  
  <p>The scalable example was:</p>
  
  <pre><code>class ScalableCircle {
      public integer getDiameter(int radius) {
          return 2*radius;
      }
  }
  </code></pre>
  
  <p>And of course it's true. Stateless scales way better.
  Given this and the fact that OBJECT = data + behavior, my questions are:</p>
  
  <p>Is OOP simply not good for highly-concurrent applications ?
  Is OOP going to die and be replaced by Procedural Programming ?</p>
  
  <p>Because even as it stands now, a lot of developers use the Anemic Domain Model and code the logic in services. There's not much OOP done really.</p>