The Artima Developer Community
Sponsored Link

Design Forum
Is this a design pattern?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sanjay Dwarkanath

Posts: 2
Nickname: sdwarka
Registered: Aug, 2003

Is this a design pattern? Posted: Aug 28, 2003 5:33 AM
Reply to this message Reply
Advertisement
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.

Topic: please i need help Previous Topic   Next Topic Topic: The Best way to ;earn Design Patterns?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use