Collaboration is one way of modeling relationship between different objets. In a collaboration, there is a has-a type of relationship reffered to as association (see Inheritance vs. Association). Collaborator objects can be of any time.
class Library def initialize @book =  end def add_book(book) @books << book end end class Book end my_library = Library.new my_book = Book.new my_library.add_book(my_book)
In the code above, there is a collaborative relationship between
Book classes within the class definition of
my_book doesn’t become associated with
my_library until the last line when we call the
In general, collaboration is view in terms of modeling relationships, i.e. even if we never call
Library#add_book (and thus never associate
my_library), it is safe to say
Book class is a collaborator for
Library because of the design decision in our code.