Hmmm, full fledged Entity System might be need for huge game. Especially if you have to store your world in a database like when doing an MMO. But, I have yet to understand the utility of separating completely the data from the functionality when you are working on a medium size game.
In small game you can just do anything in anyway you want and it might reach a working state at some point and then you can say : Hey here is my game!
In medium game you have to plan a bit and make a good OO hierarchy or your code become a mess that you are not able to work with.
The problem in planning a good OO hierarchy is that you don’t know what you want from the start. And, even when you reach the point where you know what you want, you will see it is really hard to change all the big class that have hundred lines of code in them. You might want to take some functionality of one class to put it in another but can’t get it out of that class because there is too many variable and method that you can only access within the class it is actually.
I did tried my own Entity-like system and, from trying it, it change a lot of what I initially think I should use it for.
The best things of Entity-like system for medium game is the module approach. Separate each functionality of a class in a module. That module should contain nearly all the data it needs to operate and nearly all the methods it needs. (The key word here is nearly). It is really hard to make good general code that can be reuse anywhere, so you should not try to do a general module that could be use directly by any class just by putting in it. (That’s a false dream). But, by splitting every functionality in his own module, it is really easy to refactor that module to make it work with another class.
N.B. : You might realize that by working with module you need to put a lot more methods public that you normally does in the OO way. I thought before that putting as many things with low visibility (private or protected) was the best things to do, but it’s not when you are doing game programming. You are refactoring so many things all the time that it’s a lot easier to have as many things as possible public.
N.B2. : Any code that is hard to refactor for game programming is a bad idea. OO is hard to refactor. Modules (a sort of Entity system) are easy.