Is this a pattern? I frequently find myself explaining this to others with examples such as the ones given below and was wondering whether these is a name for it.
In the object oriented world, an object may be 'self-aware' or may be a 'processor.' To illustrate, let's take a couple of typical cases:
Case 1: The Invoice object knows how to persist itself, say, in a database, and has methods save(), retrieve(), update() and delete(). The Invoice object is 'self-aware,' so to speak.
Case 2: The Invoice object just holds data and getter and setter methods plus some business logic. Another object, say, PersistenceManager, knows how to persist the Invoice object in a database. In this case the Invoice object is not self-aware and needs a 'processor.'
Another example for both cases above could be the 'Link List' and 'Link List Processor.' Some might implement a link list as a self-aware object, wherein the link list methods are used to traverse itself; in the processor approach, an iterator is used to process the link list.
I would like to know whether the above represent a pattern at all. It appears to be a pattern at such a basic level that it is part of OO fundamentals.