Sorry that i sounded so categorical
But i was looking to answer the question that started this topic and the truth is:
- if you convert class A to classes B,C,D this will not be faster (if you don't optimize in other ways) because indeed it has a cost
- and the second part of my answer is a way to determine this cost:
- if you insantiate A once and this means B,C,D each get instantiated once it might be worth the cost
- if you instantiate A once but this generates 100 instantiations of B, 100 of C and 100 of D it's already beginning to sound iffy to me
and this is where some measurements would help
IMHO classes generally look good in the beginning (OOP wise, clarity wise) and then they evolve towards greater efficiency as you add more and more to them. This is why they lose their nice look. If it all goes into the heap anyway it's perfectly feasible large classes can exist if efficiency is a top priority (as long as someone understands them).