Object responsibilities - list and item

Posted by Mark Tyler on Stack Overflow See other posts from Stack Overflow or by Mark Tyler
Published on 2010-04-04T19:28:39Z Indexed on 2010/04/04 19:33 UTC
Read the original article Hit count: 238

Filed under:
|

My question is more like a theoretical.

Say you have an object, that represents the list of something (articles, pages, accounts etc.)

class ObjCollection 

You have a class, that represents a specific item in collection:

class objItem

I have a problem thinking of a basic responsibilities of each object.

Which class is responsible for creating a new objItem?

Which class is responsible for deleting a objItem? Should it delete itself as a method?

© Stack Overflow or respective owner

Related posts about theory

Related posts about php