in reply to multi-tier collections & lack of modulization/OO

...their internal structure should not be exposed to the class that holds the collection.
Taken a step further, it goes into data transfer objects. For every return type for data access, you return a dto. This way, when your data comes back to you or your user, you don't have to wade through hash elements or arrays of arrays. You can generally make them general enough, that objects which retrieve data return similar types.

i.e. selectActiveUsers and selectInactiveUsers would return an object of the same dto class, containing all user objects.

It enforces the idea in my mind, that data structures are useful for internals to classes and to algorithms, but not as a non-volatile method of communicating to the outside/out-of-class world of your program.


Play that funky music white boy..
  • Comment on Re: multi-tier collections & lack of modulization/OO